Skip to content

Latest commit

 

History

History
327 lines (109 loc) · 6.68 KB

liveviewcomponent.md

File metadata and controls

327 lines (109 loc) · 6.68 KB

cryptobot-interface > LiveViewComponent

Class: LiveViewComponent

Implements

  • OnDestroy
  • OnInit

Index

Constructors

Properties

Methods


Constructors

new LiveViewComponent(activatedRouter: ActivatedRoute, router: Router, gdaxDataService: GdaxDataService): LiveViewComponent

Defined in app/components/live-view/live-view.component.ts:47

Constructor for the class. Injects Angular's ActivatedRoute, Router, and GdaxDataService services

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.

Returns: LiveViewComponent


Properties

«Private» activatedRouter

● activatedRouter: ActivatedRoute

Defined in app/components/live-view/live-view.component.ts:56

Angular's ActivatedRoute service for knowing current route


busySubscription

● busySubscription: Subscription

Defined in app/components/live-view/live-view.component.ts:20

Makes unsubscribing from this variable possible in OnDestroy


chart

● chart: Chart

Defined in app/components/live-view/live-view.component.ts:25

The main chart object to be constructed whenever new data is returned from the service.


chartDataSubscription

● chartDataSubscription: Subscription

Defined in app/components/live-view/live-view.component.ts:29

Makes unsubscribing from this variable possible in OnDestroy


chartReady

● chartReady: boolean = false

Defined in app/components/live-view/live-view.component.ts:33

Flag to prevent chart compilation until after chart is created.


«Private» gdaxDataService

● gdaxDataService: GdaxDataService

Defined in app/components/live-view/live-view.component.ts:58

Internal service to get queried market data.


isBusy

● isBusy: boolean = true

Defined in app/components/live-view/live-view.component.ts:38

Checks with service to see if it's busy in a query, and puts table in standby mode until it's ready.


pathState

● pathState: string = "BTC-USD"

Defined in app/components/live-view/live-view.component.ts:43

The initial path state passed in by the activatedRouter. Keeps track of what currency the chart should be viewing.


«Private» router

● router: Router

Defined in app/components/live-view/live-view.component.ts:57

Angular's Router service for changing route


urlSubscription

● urlSubscription: Subscription

Defined in app/components/live-view/live-view.component.ts:47

Makes unsubscribing from this variable possible in OnDestroy


Methods

«Private» ngOnDestroy

ngOnDestroy(): void

Defined in app/components/live-view/live-view.component.ts:64

Returns: void


ngOnInit

ngOnInit(): void

Defined in app/components/live-view/live-view.component.ts:84

Triggered when component is loaded, but before it is viewed. Gets REST path info, and updates the profit chart.

Returns: void


updateChart

updateChart(data: number[][]): void

Defined in app/components/live-view/live-view.component.ts:102

When new data is received, it's passed to this function. Here the chart details assembled, and the chartReady flag is released.

Parameters:

Param Type Description
data number[][] queried market data passed from the GdaxDataService.

Returns: void