cryptobot-interface > FilterControlsComponent
OnDestroy
OnInit
- activatedRouter
- busySubscription
- config
- endDate
- gdaxDataService
- invalidEndDatetime
- invalidStartDatetime
- isBusy
- isInitialized
- isInvalid
- isRelevant
- isRelevantSubscription
- maxEndDate
- maxStartDate
- minEndDate
- minStartDate
- params
- queryParamSubscription
- router
- startDate
- timeInterval
- timeIntervalLabel
- timeIntervalOptions
- timeIntervals
- timeoutId
- tooltip
- warningMessage
- adjustGranularityOptions
- changedTimeInterval
- checkValidDateTime
- checkValidDateTimeOrder
- checkValidDay
- checkValidHours
- checkValidMinutes
- checkValidMonth
- checkValidYear
- closeTooltip
- handleEndDateTimeParam
- handleGranularityParam
- handleIncorrectDateTimeParams
- handleInitialParamUpdate
- handleStartDateTimeParam
- isTooltipOpen
- ngOnDestroy
- ngOnInit
- onEndDateTimeChange
- onStartDateTimeChange
- openTooltip
- resetMinMax
- setADateTime
- updateParams
⊕ new FilterControlsComponent(activatedRouter: ActivatedRoute
, router: Router
, gdaxDataService: GdaxDataService, config: NgbTimepickerConfig
): FilterControlsComponent
Defined in app/components/filter-controls/filter-controls.component.ts:162
Constructor for the class
Parameters:
Param | Type | Description |
---|---|---|
activatedRouter | ActivatedRoute |
Angular's ActivatedRoute service for knowing current route |
router | Router |
Angular's Router service for changing route |
gdaxDataService | GdaxDataService | Internal service to get queried market data. |
config | NgbTimepickerConfig |
Configuration service for ngb's timepicker |
Returns: FilterControlsComponent
● activatedRouter: ActivatedRoute
Defined in app/components/filter-controls/filter-controls.component.ts:172
Angular's ActivatedRoute service for knowing current route
● busySubscription: Subscription
Defined in app/components/filter-controls/filter-controls.component.ts:20
Makes unsubscribing from this variable possible in OnDestroy
● config: NgbTimepickerConfig
Defined in app/components/filter-controls/filter-controls.component.ts:175
Configuration service for ngb's timepicker
● endDate: Date
= new Date((new Date()).getTime() - 360000)
Defined in app/components/filter-controls/filter-controls.component.ts:24
Maintains the end date in actual Javascript Date form
● gdaxDataService: GdaxDataService
Defined in app/components/filter-controls/filter-controls.component.ts:174
Internal service to get queried market data.
● invalidEndDatetime: boolean
= false
Defined in app/components/filter-controls/filter-controls.component.ts:70
Flag to determine whether or not to display red for end datetime
● invalidStartDatetime: boolean
= false
Defined in app/components/filter-controls/filter-controls.component.ts:66
Flag to determine whether or not to display red for start datetime
● isBusy: boolean
= true
Defined in app/components/filter-controls/filter-controls.component.ts:44
Checks with service to see if it's busy in a query, and disables controls when it is.
● isInitialized: boolean
= false
Defined in app/components/filter-controls/filter-controls.component.ts:48
Skips change detections on start and end dates until inital settings are finished.
● isInvalid: boolean
= false
Defined in app/components/filter-controls/filter-controls.component.ts:62
Flag to determine whether or not to show invalid data colors inside the datetime filters.
● isRelevant: boolean
= true
Defined in app/components/filter-controls/filter-controls.component.ts:53
Checks with service to see if granularity control is relevant in a query, and disables control when it isn't.
● isRelevantSubscription: Subscription
Defined in app/components/filter-controls/filter-controls.component.ts:57
Makes unsubscribing from this variable possible in OnDestroy
● maxEndDate: object
Defined in app/components/filter-controls/filter-controls.component.ts:74
Max date a dropdown from end date ngb-tooltip should show
day: number
month: number
year: number
● maxStartDate: object
Defined in app/components/filter-controls/filter-controls.component.ts:78
Max date a dropdown from start date ngb-tooltip should show
day: number
month: number
year: number
● minEndDate: object
Defined in app/components/filter-controls/filter-controls.component.ts:82
Min date a dropdown from end date ngb-tooltip should show
day: number
month: number
year: number
● minStartDate: object
Defined in app/components/filter-controls/filter-controls.component.ts:86
Min date a dropdown from start date ngb-tooltip should show
day: number
month: number
year: number
● params: ParamMap
Defined in app/components/filter-controls/filter-controls.component.ts:90
Holds query params to check against in other parts of component
● queryParamSubscription: Subscription
Defined in app/components/filter-controls/filter-controls.component.ts:94
Makes unsubscribing from this variable possible in OnDestroy
● router: Router
Defined in app/components/filter-controls/filter-controls.component.ts:173
Angular's Router service for changing route
● startDate: Date
= new Date(this.endDate.getTime() - 87600000)
Defined in app/components/filter-controls/filter-controls.component.ts:98
Maintains the start date in actual Javascript Date form
● timeInterval: number
= 3600
Defined in app/components/filter-controls/filter-controls.component.ts:117
Maintains current granularity level (ie. 3600)
● timeIntervalLabel: string
= "1 hour"
Defined in app/components/filter-controls/filter-controls.component.ts:121
Maintains current granularity level label (ie. '1 hour')
● timeIntervalOptions: object
[] = [
{
label: '5 minutes',
value: 300
},
{
label: '15 minutes',
value: 900
},
{
label: '1 hour',
value: 3600
},
{
label: '6 hours',
value: 21600
},
{
label: '1 day',
value: 86400
}
]
Defined in app/components/filter-controls/filter-controls.component.ts:125
Contains all possible granularity levels
● timeIntervals: object
[] = this.timeIntervalOptions.slice()
Defined in app/components/filter-controls/filter-controls.component.ts:150
Contains all possible granularity levels available to end user
● timeoutId: any
= null
Defined in app/components/filter-controls/filter-controls.component.ts:154
Message to use if start datetime is invalid
● tooltip: NgbTooltip
Defined in app/components/filter-controls/filter-controls.component.ts:16
● warningMessage: string
[] = [
'Start datetime must be before End datetime.',
'Datetimes must be at least more than 10 minutes apart.',
'Datetimes must be less than 299 days apart.'
]
Defined in app/components/filter-controls/filter-controls.component.ts:158
Message to use if start datetime is invalid
► adjustGranularityOptions(forcedChangedTimeInterval?: boolean
): void
Defined in app/components/filter-controls/filter-controls.component.ts:233
Checks which of the time intervals have no more than the gdax max of 300 results between start and end datetimes
Parameters:
Param | Type | Description |
---|---|---|
forcedChangedTimeInterval | boolean |
signals whether to force a changedTimeInterval call |
Returns: void
► changedTimeInterval(event: any
, initChange?: boolean
): void
Defined in app/components/filter-controls/filter-controls.component.ts:288
Triggered when user changes granularity choice Updates the service variable
Parameters:
Param | Type | Description |
---|---|---|
event | any |
label/value object containing granularity label and value |
initChange | boolean |
signals service that this is the OnInit value change. |
Returns: void
► checkValidDateTime(): boolean
Defined in app/components/filter-controls/filter-controls.component.ts:305
Checks all aspects of both datetimes to make sure everything is valid
Returns: boolean
True is valid datetimes | False if something is wrong with one of them
► checkValidDateTimeOrder(): boolean
Defined in app/components/filter-controls/filter-controls.component.ts:324
Checks to make sure end datetime isn't before the start datetime
Returns: boolean
True is valid | False if invalid
► checkValidDay(date: object
): boolean
Defined in app/components/filter-controls/filter-controls.component.ts:343
Checks to make sure day is valid
Parameters:
Param | Type | Description |
---|---|---|
date | object |
- |
Returns: boolean
True is valid | False if invalid
► checkValidHours(time: object
): boolean
Defined in app/components/filter-controls/filter-controls.component.ts:356
Checks to make sure hour is valid
Parameters:
Param | Type | Description |
---|---|---|
time | object |
- |
Returns: boolean
True is valid | False if invalid
► checkValidMinutes(time: object
): boolean
Defined in app/components/filter-controls/filter-controls.component.ts:369
Checks to make sure minute is valid
Parameters:
Param | Type | Description |
---|---|---|
time | object |
- |
Returns: boolean
True is valid | False if invalid
► checkValidMonth(date: object
): boolean
Defined in app/components/filter-controls/filter-controls.component.ts:382
Checks to make sure month is valid
Parameters:
Param | Type | Description |
---|---|---|
date | object |
- |
Returns: boolean
True is valid | False if invalid
► checkValidYear(date: object
): boolean
Defined in app/components/filter-controls/filter-controls.component.ts:395
Checks to make sure year is valid
Parameters:
Param | Type | Description |
---|---|---|
date | object |
- |
Returns: boolean
True is valid | False if invalid
► closeTooltip(): void
Defined in app/components/filter-controls/filter-controls.component.ts:407
Closes the datetime warning tooltip if it's open
Returns: void
► handleEndDateTimeParam(): void
Defined in app/components/filter-controls/filter-controls.component.ts:418
Returns: void
► handleGranularityParam(): void
Defined in app/components/filter-controls/filter-controls.component.ts:456
Returns: void
► handleIncorrectDateTimeParams(): void
Defined in app/components/filter-controls/filter-controls.component.ts:474
Returns: void
► handleInitialParamUpdate(): void
Defined in app/components/filter-controls/filter-controls.component.ts:490
Returns: void
► handleStartDateTimeParam(): void
Defined in app/components/filter-controls/filter-controls.component.ts:515
Returns: void
► isTooltipOpen(): boolean
Defined in app/components/filter-controls/filter-controls.component.ts:551
Tells whether or not the warningMessage tooltip is open or not
Returns: boolean
True if the warning tooltip is open } False if not
► ngOnDestroy(): void
Defined in app/components/filter-controls/filter-controls.component.ts:184
Returns: void
► ngOnInit(): void
Defined in app/components/filter-controls/filter-controls.component.ts:204
Returns: void
► onEndDateTimeChange(): void
Defined in app/components/filter-controls/filter-controls.component.ts:558
Triggered when user changes end datetime choice Updates the service variable
Returns: void
► onStartDateTimeChange(): void
Defined in app/components/filter-controls/filter-controls.component.ts:583
Triggered when user changes start datetime choice Updates the service variable
Returns: void
► openTooltip(): void
Defined in app/components/filter-controls/filter-controls.component.ts:607
Opens the datetime warning tooltip if it's closed
Returns: void
► resetMinMax(): void
Defined in app/components/filter-controls/filter-controls.component.ts:616
Changes the min and max dates for both datepickers when one changes
Returns: void
► setADateTime(dateObject: Date
, dateVarToUpdate: object
, timeVarToUpdate: object
): void
Defined in app/components/filter-controls/filter-controls.component.ts:647
Updates the date and time objects based on dateObject Date parameter
Parameters:
Param | Type | Description |
---|---|---|
dateObject | Date |
Date used to update the dateVarToUpdate & timeVarToUpdate objects |
dateVarToUpdate | object |
ngbDatepicker friendly object used as either start or end date |
timeVarToUpdate | object |
ngbTimepicker friendly object used as either start or end time |
Returns: void
► updateParams(params: __type
): void
Defined in app/components/filter-controls/filter-controls.component.ts:661
Called when params need updating. Avoids repetition.
Parameters:
Param | Type | Description |
---|---|---|
params | __type |
param object used to update queryParams |
Returns: void
Maintains the end date for 'End Date:' datepicker
● day: number
= this.endDate.getDate()
Defined in app/components/filter-controls/filter-controls.component.ts:31
● month: number
= this.endDate.getMonth() + 1
Defined in app/components/filter-controls/filter-controls.component.ts:30
● year: number
= this.endDate.getFullYear()
Defined in app/components/filter-controls/filter-controls.component.ts:29
Maintains the end time for 'End Time:' timepicker
● hour: number
= this.endDate.getHours()
Defined in app/components/filter-controls/filter-controls.component.ts:37
● minute: number
= this.endDate.getMinutes()
Defined in app/components/filter-controls/filter-controls.component.ts:38
Maintains the start date for 'Start Date:' datepicker
● day: number
= this.startDate.getDate()
Defined in app/components/filter-controls/filter-controls.component.ts:105
● month: number
= this.startDate.getMonth() + 1
Defined in app/components/filter-controls/filter-controls.component.ts:104
● year: number
= this.startDate.getFullYear()
Defined in app/components/filter-controls/filter-controls.component.ts:103
Maintains the start time for 'Start Time:' timepicker
● hour: number
= this.startDate.getHours()
Defined in app/components/filter-controls/filter-controls.component.ts:111
● minute: number
= this.startDate.getMinutes()
Defined in app/components/filter-controls/filter-controls.component.ts:112