-
Notifications
You must be signed in to change notification settings - Fork 6
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge branch 'displacement' into tyler/best-fit-line
- Loading branch information
Showing
14 changed files
with
113 additions
and
104 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
32 changes: 29 additions & 3 deletions
32
src/app/components/header/timeseries-header/timeseries-header.component.ts
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,33 +1,59 @@ | ||
import { Component } from '@angular/core'; | ||
import { Component, OnInit, OnDestroy } from '@angular/core'; | ||
import { SubSink } from 'subsink'; | ||
|
||
import { Store } from '@ngrx/store'; | ||
import { AppState } from '@store'; | ||
import * as uiStore from '@store/ui'; | ||
import * as searchStore from '@store/search'; | ||
import * as mapStore from '@store/map'; | ||
|
||
import { ScreenSizeService } from '@services'; | ||
import { Breakpoints } from '@models'; | ||
import { Breakpoints, MapDrawModeType, MapInteractionModeType } from '@models'; | ||
|
||
@Component({ | ||
selector: 'app-timeseries-header', | ||
templateUrl: './timeseries-header.component.html', | ||
styleUrls: ['./timeseries-header.component.scss', '../header.component.scss'] | ||
}) | ||
export class TimeseriesHeaderComponent { | ||
export class TimeseriesHeaderComponent implements OnInit, OnDestroy { | ||
public breakpoint$ = this.screenSize.breakpoint$; | ||
public breakpoints = Breakpoints; | ||
public isAddingPoints = false; | ||
|
||
private subs = new SubSink(); | ||
|
||
constructor( | ||
private store$: Store<AppState>, | ||
private screenSize: ScreenSizeService | ||
) { } | ||
|
||
ngOnInit() { | ||
this.subs.add( | ||
this.store$.select(mapStore.getMapInteractionMode).subscribe( | ||
mode => this.isAddingPoints = mode === MapInteractionModeType.DRAW | ||
) | ||
); | ||
|
||
} | ||
|
||
public onAddPointsMode(): void { | ||
console.log('points'); | ||
this.store$.dispatch(new mapStore.SetMapInteractionMode(MapInteractionModeType.DRAW)); | ||
this.store$.dispatch(new mapStore.SetMapDrawMode(MapDrawModeType.POINT)); | ||
} | ||
|
||
public onStopAddPoints(): void { | ||
this.store$.dispatch(new mapStore.SetMapInteractionMode(MapInteractionModeType.NONE)); | ||
} | ||
|
||
|
||
public onToggleFiltersMenu(): void { | ||
this.store$.dispatch(new uiStore.OpenFiltersMenu()); | ||
} | ||
|
||
public isKioskMode$ = this.store$.select(searchStore.getKioskMode); | ||
|
||
ngOnDestroy() { | ||
this.subs.unsubscribe(); | ||
} | ||
} |
6 changes: 4 additions & 2 deletions
6
src/app/components/map/displacement-layers/displacement-layers.component.html
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.