Skip to content

Commit

Permalink
Merge pull request #1983 from asfadmin/andy/displacement/DS-5552-UI-P…
Browse files Browse the repository at this point in the history
…olish

DS-5552 UI polish
  • Loading branch information
artisticlight authored Sep 26, 2024
2 parents 4ce2138 + a335170 commit 51849fd
Show file tree
Hide file tree
Showing 17 changed files with 227 additions and 94 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -74,31 +74,31 @@
</div>
<mat-card-subtitle [class.medium-header]="breakpoint <= breakpoints.MEDIUM" class="ts-header">

<div class="ts-button-group">
<div class="button-group-label">
<label>{{ 'ZOOM' | translate }}</label>
</div>
<div class="fx-row">
<div>
<mat-button-toggle-group class="ts-toggle-group" name="layerType">
<mat-button-toggle class="control-mat-button-toggle" (click)="zoomIn()"
matTooltip="{{ 'ZOOM_IN' | translate }}">
<mat-icon class="control-icon">add</mat-icon>
</mat-button-toggle>

<mat-button-toggle class="control-mat-button-toggle" (click)="zoomToFit()"
matTooltip="{{ 'ZOOM_TO_FIT' | translate }}">
<mat-icon class="control-icon">aspect_ratio</mat-icon>
</mat-button-toggle>

<mat-button-toggle class="control-mat-button-toggle" (click)="zoomOut()"
matTooltip="{{ 'ZOOM_OUT' | translate }}">
<mat-icon class="control-icon">remove</mat-icon>
</mat-button-toggle>
</mat-button-toggle-group>
</div>
</div>
</div>
<!-- <div class="ts-button-group">-->
<!-- <div class="button-group-label">-->
<!-- <label>{{ 'ZOOM' | translate }}</label>-->
<!-- </div>-->
<!-- <div class="fx-row">-->
<!-- <div>-->
<!-- <mat-button-toggle-group class="ts-toggle-group" name="layerType">-->
<!-- <mat-button-toggle class="control-mat-button-toggle" (click)="zoomIn()"-->
<!-- matTooltip="{{ 'ZOOM_IN' | translate }}">-->
<!-- <mat-icon class="control-icon">add</mat-icon>-->
<!-- </mat-button-toggle>-->

<!-- <mat-button-toggle class="control-mat-button-toggle" (click)="zoomToFit()"-->
<!-- matTooltip="{{ 'ZOOM_TO_FIT' | translate }}">-->
<!-- <mat-icon class="control-icon">aspect_ratio</mat-icon>-->
<!-- </mat-button-toggle>-->

<!-- <mat-button-toggle class="control-mat-button-toggle" (click)="zoomOut()"-->
<!-- matTooltip="{{ 'ZOOM_OUT' | translate }}">-->
<!-- <mat-icon class="control-icon">remove</mat-icon>-->
<!-- </mat-button-toggle>-->
<!-- </mat-button-toggle-group>-->
<!-- </div>-->
<!-- </div>-->
<!-- </div>-->

<div class="ts-button-group-filler ts-button-group"></div>

Expand All @@ -110,7 +110,11 @@
<div class="toggle-group-wrapper--layout">
<mat-button-toggle class="control-mat-button-toggle ts-criteria-button-toggle"
(click)="onToggleFiltersMenu()">
{{ 'DISPLACEMENT_FILTERS' | translate }}<mat-icon class="more-horiz">more_horiz</mat-icon>
<span class="material-symbols-outlined">
filter_alt
</span>
<!-- <mat-icon>filter_alt</mat-icon>-->
<!-- {{ 'DISPLACEMENT_FILTERS' | translate }}<mat-icon class="more-horiz">more_horiz</mat-icon>-->
</mat-button-toggle>
</div>
</div>
Expand All @@ -123,10 +127,9 @@
<div class="ts-chart-row">
<div id="ts-chart-column">
<app-timeseries-chart
[zoomIn$]="zoomInChart$"
[zoomToFit$]="zoomToFitChart$"
[zoomOut$]="zoomOutChart$"
[chartData]="chartData"></app-timeseries-chart>
[chartData]="chartData">
</app-timeseries-chart>
<app-timeseries-chart-temporal-slider></app-timeseries-chart-temporal-slider>
</div>
</div>

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -6,6 +6,9 @@
display: flex;
flex-direction: row;
height: calc(100%);
margin-top: 12px;
margin-right: 12px;
position: relative;
}

.ts-chart-card {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -8,16 +8,16 @@ import * as uiStore from '@store/ui';
import * as searchStore from '@store/search';
import * as mapStore from '@store/map';

import { Breakpoints, SearchType, MapInteractionModeType, MapDrawModeType } from '@models';
import { Breakpoints, SearchType, MapInteractionModeType, MapDrawModeType } from '@models';
import { DrawService, MapService, NetcdfService, PointHistoryService, ScreenSizeService } from '@services';

import { SubSink } from 'subsink';

import { Point} from 'ol/geom';
import { Point } from 'ol/geom';
import { WKT } from 'ol/format';
import moment2 from 'moment';
import { SetScenes } from '@store/scenes';
import {getPathRange} from '@store/filters';
import { getPathRange } from '@store/filters';


@Component({
Expand Down Expand Up @@ -47,10 +47,6 @@ export class TimeseriesResultsMenuComponent implements OnInit, OnDestroy {
public breakpoints = Breakpoints;
private subs = new SubSink();

public zoomInChart$ = new Subject<void>();
public zoomOutChart$ = new Subject<void>();
public zoomToFitChart$ = new Subject<void>();

public pointHistory = [];

public chartData = new Subject<any>;
Expand Down Expand Up @@ -126,18 +122,6 @@ export class TimeseriesResultsMenuComponent implements OnInit, OnDestroy {
this.store$.dispatch(new uiStore.OpenFiltersMenu());
}

public zoomIn(): void {
this.zoomInChart$.next();
}

public zoomOut(): void {
this.zoomOutChart$.next();
}

public zoomToFit(): void {
this.zoomToFitChart$.next();
}

public onOpenHelp(url: string): void {
window.open(url);
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -17,30 +17,34 @@ import { ResizableModule } from 'angular-resizable-element';
import { MatRadioModule } from '@angular/material/radio';
import { PipesModule } from '@pipes';
import {MatTab, MatTabGroup} from '@angular/material/tabs';
import {
TimeseriesChartTemporalSliderComponent
} from '@components/timeseries-chart/timeseries-chart-temporal-slider/timeseries-chart-temporal-slider.component';


@NgModule({
declarations: [
TimeseriesResultsMenuComponent
],
imports: [
CommonModule,
MatMenuModule,
MatIconModule,
MatSharedModule,
MatButtonToggleModule,
FontAwesomeModule,
SharedModule,
ScenesListModule,
ScenesListHeaderModule,
SceneMetadataModule,
TimeseriesChartModule,
ResizableModule,
MatRadioModule,
PipesModule,
MatTabGroup,
MatTab
],
imports: [
CommonModule,
MatMenuModule,
MatIconModule,
MatSharedModule,
MatButtonToggleModule,
FontAwesomeModule,
SharedModule,
ScenesListModule,
ScenesListHeaderModule,
SceneMetadataModule,
TimeseriesChartModule,
ResizableModule,
MatRadioModule,
PipesModule,
MatTabGroup,
MatTab,
TimeseriesChartTemporalSliderComponent
],
exports: [
TimeseriesResultsMenuComponent
]
Expand Down
13 changes: 8 additions & 5 deletions src/app/components/shared/chart-modal/chart-modal.component.html
Original file line number Diff line number Diff line change
@@ -1,12 +1,15 @@
<div class="toggle-group-wrapper--layout">
<mat-button-toggle [matMenuTriggerFor]="menu" type="button"
class="control-mat-button-toggle ts-criteria-button-toggle">
chart config<mat-icon class="more-horiz">shape_line</mat-icon>
</mat-button-toggle>
<button mat-mini-fab [matMenuTriggerFor]="menu" type="button"
class="control-mat-button-toggle ts-criteria-button-toggle"
aria-label="Icon with a menu for configuring Displacement chart">
<mat-icon class="settings-icon">
settings
</mat-icon>
</button>
</div>
<mat-menu #menu="matMenu">
<div class="chart-config-menu-panel" [ngSwitch]="searchType" (click)="$event.stopPropagation()">
<app-timeseries-chart-config *ngSwitchCase="SearchTypes.DISPLACEMENT"></app-timeseries-chart-config>
<app-timeseries-chart-config *ngSwitchDefault></app-timeseries-chart-config>
</div>
</mat-menu>
</mat-menu>
20 changes: 15 additions & 5 deletions src/app/components/shared/chart-modal/chart-modal.component.scss
Original file line number Diff line number Diff line change
@@ -1,5 +1,4 @@
@use "@angular/material" as mat;

@import "asf-theme";
$config: mat.define-legacy-typography-config();

Expand Down Expand Up @@ -27,9 +26,20 @@ $config: mat.define-legacy-typography-config();
font-size: 14px;
}

.more-horiz {
font-size: 16px !important;
margin-left: 0;
.mdc-fab--mini {
width: 20px;
height: 20px;
text-align: center;
padding-top: 8px;
border-radius: 4px !important;
}

.settings-icon {
@include themify($themes) {
color: themed('dark-primary-text') !important;
}
font-size: 16px !important;
margin-left: 0;
}

.toggle-group-wrapper--layout {
Expand All @@ -41,6 +51,6 @@ $config: mat.define-legacy-typography-config();
}

.chart-config-menu-panel {
padding-left: 15px;
padding-left: 15px;
padding-right: 15px;
}
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
<p>timeseries-chart-temporal-slider works!</p>
Original file line number Diff line number Diff line change
@@ -0,0 +1,12 @@
import { Component } from '@angular/core';

@Component({
selector: 'app-timeseries-chart-temporal-slider',
standalone: true,
imports: [],
templateUrl: './timeseries-chart-temporal-slider.component.html',
styleUrl: './timeseries-chart-temporal-slider.component.scss'
})
export class TimeseriesChartTemporalSliderComponent {

}
Original file line number Diff line number Diff line change
@@ -0,0 +1,22 @@
<div class="ts-button-group">
<div class="fx-row">
<div>
<mat-button-toggle-group class="ts-toggle-group" name="layerType">
<mat-button-toggle class="control-mat-button-toggle" (click)="zoomIn()"
matTooltip="{{ 'ZOOM_IN' | translate }}">
<mat-icon class="control-icon">add</mat-icon>
</mat-button-toggle>

<mat-button-toggle class="control-mat-button-toggle" (click)="zoomToFit()"
matTooltip="{{ 'ZOOM_TO_FIT' | translate }}">
<mat-icon class="control-icon">aspect_ratio</mat-icon>
</mat-button-toggle>

<mat-button-toggle class="control-mat-button-toggle" (click)="zoomOut()"
matTooltip="{{ 'ZOOM_OUT' | translate }}">
<mat-icon class="control-icon">remove</mat-icon>
</mat-button-toggle>
</mat-button-toggle-group>
</div>
</div>
</div>
Original file line number Diff line number Diff line change
@@ -0,0 +1,17 @@
@use "@angular/material" as mat;
@import "asf-theme";

.ts-toggle-group {
height: 20px !important;
box-shadow: rgba(0, 0, 0, 0.2) 0px 3px 5px -1px,
rgba(0, 0, 0, 0.14) 0px 6px 10px 0px,
rgba(0, 0, 0, 0.12) 0px 1px 18px 0px;
}

.control-icon {
font-size: 16px;
}

::ng-deep .mat-button-toggle-appearance-standard .mat-button-toggle-label-content {
padding: 0 5px !important;
}
Original file line number Diff line number Diff line change
@@ -0,0 +1,45 @@
import {Component, EventEmitter, Output} from '@angular/core';
import {MatButtonToggle, MatButtonToggleGroup} from '@angular/material/button-toggle';
import {MatIcon} from '@angular/material/icon';
import {MatTooltip} from '@angular/material/tooltip';
import {TranslateModule} from '@ngx-translate/core';

@Component({
selector: 'app-timeseries-chart-zoom',
standalone: true,
imports: [
MatButtonToggle,
MatButtonToggleGroup,
MatIcon,
MatTooltip,
TranslateModule
],
templateUrl: './timeseries-chart-zoom.component.html',
styleUrl: './timeseries-chart-zoom.component.scss'
})
export class TimeseriesChartZoomComponent {
// @Output('zoomIn$') zoomIn$: Subject<void> = new Subject<void>();
// @Output('zoomInChart$') zoomInChart$: EventEmitter<any> = new EventEmitter();
@Output() zoomInEvent = new EventEmitter<void>();
@Output() zoomOutEvent = new EventEmitter<void>();
@Output() zoomToFitEvent = new EventEmitter<void>();

// public zoomInChart$ = new Subject<void>();
// public zoomOutChart$ = new Subject<void>();
// public zoomToFitChart$ = new Subject<void>();

public zoomIn(): void {
console.log('zoomIn');
this.zoomInEvent.emit();
}

public zoomOut(): void {
this.zoomOutEvent.emit();
}

public zoomToFit(): void {
this.zoomToFitEvent.emit();
}


}
Original file line number Diff line number Diff line change
Expand Up @@ -2,4 +2,9 @@
<div #tsChartWrapper class="chart-wrapper" (resized)="onResized()">
<div #timeseriesChart id="timeseriesChart"></div>
<app-chart-modal class="ts-chart-config-button"></app-chart-modal>
<app-timeseries-chart-zoom class="ts-chart-zoom"
(zoomInEvent)="onZoomIn()"
(zoomOutEvent)="onZoomOut()"
(zoomToFitEvent)="onZoomToFit()"
></app-timeseries-chart-zoom>
</div>
Loading

0 comments on commit 51849fd

Please sign in to comment.