Skip to content

Latest commit

 

History

History
1544 lines (489 loc) · 29.7 KB

filtercontrolscomponent.md

File metadata and controls

1544 lines (489 loc) · 29.7 KB

cryptobot-interface > FilterControlsComponent

Class: FilterControlsComponent

Implements

  • OnDestroy
  • OnInit

Index

Constructors

Properties

Methods

Object literals


Constructors

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


Properties

«Private» activatedRouter

● activatedRouter: ActivatedRoute

Defined in app/components/filter-controls/filter-controls.component.ts:172

Angular's ActivatedRoute service for knowing current route


busySubscription

● busySubscription: Subscription

Defined in app/components/filter-controls/filter-controls.component.ts:20

Makes unsubscribing from this variable possible in OnDestroy


«Private» config

● config: NgbTimepickerConfig

Defined in app/components/filter-controls/filter-controls.component.ts:175

Configuration service for ngb's timepicker


endDate

● 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


«Private» gdaxDataService

● gdaxDataService: GdaxDataService

Defined in app/components/filter-controls/filter-controls.component.ts:174

Internal service to get queried market data.


invalidEndDatetime

● 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

● 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

● 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

● 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

● 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

● 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

● isRelevantSubscription: Subscription

Defined in app/components/filter-controls/filter-controls.component.ts:57

Makes unsubscribing from this variable possible in OnDestroy


maxEndDate

● maxEndDate: object

Defined in app/components/filter-controls/filter-controls.component.ts:74

Max date a dropdown from end date ngb-tooltip should show

Type declaration

day: number

month: number

year: number


maxStartDate

● maxStartDate: object

Defined in app/components/filter-controls/filter-controls.component.ts:78

Max date a dropdown from start date ngb-tooltip should show

Type declaration

day: number

month: number

year: number


minEndDate

● minEndDate: object

Defined in app/components/filter-controls/filter-controls.component.ts:82

Min date a dropdown from end date ngb-tooltip should show

Type declaration

day: number

month: number

year: number


minStartDate

● minStartDate: object

Defined in app/components/filter-controls/filter-controls.component.ts:86

Min date a dropdown from start date ngb-tooltip should show

Type declaration

day: number

month: number

year: number


params

● 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

● queryParamSubscription: Subscription

Defined in app/components/filter-controls/filter-controls.component.ts:94

Makes unsubscribing from this variable possible in OnDestroy


«Private» router

● router: Router

Defined in app/components/filter-controls/filter-controls.component.ts:173

Angular's Router service for changing route


startDate

● 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

● timeInterval: number = 3600

Defined in app/components/filter-controls/filter-controls.component.ts:117

Maintains current granularity level (ie. 3600)


timeIntervalLabel

● timeIntervalLabel: string = "1 hour"

Defined in app/components/filter-controls/filter-controls.component.ts:121

Maintains current granularity level label (ie. '1 hour')


timeIntervalOptions

● 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

● 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

● timeoutId: any = null

Defined in app/components/filter-controls/filter-controls.component.ts:154

Message to use if start datetime is invalid


tooltip

● tooltip: NgbTooltip

Defined in app/components/filter-controls/filter-controls.component.ts:16


warningMessage

● 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


Methods

adjustGranularityOptions

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

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

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

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

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

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

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

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

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

closeTooltip(): void

Defined in app/components/filter-controls/filter-controls.component.ts:407

Closes the datetime warning tooltip if it's open

Returns: void


«Private» handleEndDateTimeParam

handleEndDateTimeParam(): void

Defined in app/components/filter-controls/filter-controls.component.ts:418

Returns: void


«Private» handleGranularityParam

handleGranularityParam(): void

Defined in app/components/filter-controls/filter-controls.component.ts:456

Returns: void


«Private» handleIncorrectDateTimeParams

handleIncorrectDateTimeParams(): void

Defined in app/components/filter-controls/filter-controls.component.ts:474

Returns: void


«Private» handleInitialParamUpdate

handleInitialParamUpdate(): void

Defined in app/components/filter-controls/filter-controls.component.ts:490

Returns: void


«Private» handleStartDateTimeParam

handleStartDateTimeParam(): void

Defined in app/components/filter-controls/filter-controls.component.ts:515

Returns: void


isTooltipOpen

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


«Private» ngOnDestroy

ngOnDestroy(): void

Defined in app/components/filter-controls/filter-controls.component.ts:184

Returns: void


«Private» ngOnInit

ngOnInit(): void

Defined in app/components/filter-controls/filter-controls.component.ts:204

Returns: void


onEndDateTimeChange

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

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

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

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

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

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


Object literal: eDate

Maintains the end date for 'End Date:' datepicker

day

● day: number = this.endDate.getDate()

Defined in app/components/filter-controls/filter-controls.component.ts:31


month

● month: number = this.endDate.getMonth() + 1

Defined in app/components/filter-controls/filter-controls.component.ts:30


year

● year: number = this.endDate.getFullYear()

Defined in app/components/filter-controls/filter-controls.component.ts:29


Object literal: eTime

Maintains the end time for 'End Time:' timepicker

hour

● hour: number = this.endDate.getHours()

Defined in app/components/filter-controls/filter-controls.component.ts:37


minute

● minute: number = this.endDate.getMinutes()

Defined in app/components/filter-controls/filter-controls.component.ts:38


Object literal: sDate

Maintains the start date for 'Start Date:' datepicker

day

● day: number = this.startDate.getDate()

Defined in app/components/filter-controls/filter-controls.component.ts:105


month

● month: number = this.startDate.getMonth() + 1

Defined in app/components/filter-controls/filter-controls.component.ts:104


year

● year: number = this.startDate.getFullYear()

Defined in app/components/filter-controls/filter-controls.component.ts:103


Object literal: sTime

Maintains the start time for 'Start Time:' timepicker

hour

● hour: number = this.startDate.getHours()

Defined in app/components/filter-controls/filter-controls.component.ts:111


minute

● minute: number = this.startDate.getMinutes()

Defined in app/components/filter-controls/filter-controls.component.ts:112