components/plots/plots.component.ts
Ground motion vs distance Ploty plot with parameter summary.
selector | app-plots |
imports |
NshmpLibNgPlotsContainerComponent
NshmpLibNgPlotComponent
NshmpLibNgAppMetadataComponent
MatAccordion
MatExpansionPanel
MatExpansionPanelHeader
MatExpansionPanelTitle
MatDivider
ParameterSummaryComponent
|
templateUrl | ./plots.component.html |
styleUrl | ./plots.component.scss |
Properties |
|
constructor(service: AppService)
|
||||||
Defined in components/plots/plots.component.ts:42
|
||||||
Parameters :
|
meanPlotData |
Default value : computed(() => this.service.meanPlotState()?.plotData)
|
Defined in components/plots/plots.component.ts:39
|
GM vs distance plot data |
repositories |
Default value : computed(() => this.service.usage()?.metadata.repositories)
|
Defined in components/plots/plots.component.ts:42
|
Repo metadata |
Public service |
Type : AppService
|
Defined in components/plots/plots.component.ts:44
|
import {Component, computed} from '@angular/core';
import {MatDivider} from '@angular/material/divider';
import {
MatAccordion,
MatExpansionPanel,
MatExpansionPanelHeader,
MatExpansionPanelTitle,
} from '@angular/material/expansion';
import {NshmpLibNgAppMetadataComponent} from '@ghsc/nshmp-lib-ng/nshmp';
import {
NshmpLibNgPlotComponent,
NshmpLibNgPlotsContainerComponent,
} from '@ghsc/nshmp-lib-ng/plot';
import {AppService} from '../../services/app.service';
import {ParameterSummaryComponent} from '../parameter-summary/parameter-summary.component';
/**
* Ground motion vs distance Ploty plot with parameter summary.
*/
@Component({
imports: [
NshmpLibNgPlotsContainerComponent,
NshmpLibNgPlotComponent,
NshmpLibNgAppMetadataComponent,
MatAccordion,
MatExpansionPanel,
MatExpansionPanelHeader,
MatExpansionPanelTitle,
MatDivider,
ParameterSummaryComponent,
],
selector: 'app-plots',
styleUrl: './plots.component.scss',
templateUrl: './plots.component.html',
})
export class PlotsComponent {
/** GM vs distance plot data */
meanPlotData = computed(() => this.service.meanPlotState()?.plotData);
/** Repo metadata */
repositories = computed(() => this.service.usage()?.metadata.repositories);
constructor(public service: AppService) {}
}
<!-- Means -->
<nshmp-lib-ng-plots-container>
<mat-accordion multi>
<!-- GMM vs. distance plot -->
<mat-expansion-panel expanded>
<mat-expansion-panel-header>
<mat-panel-title>Ground Motion</mat-panel-title>
</mat-expansion-panel-header>
<mat-divider />
@if (meanPlotData()) {
<nshmp-lib-ng-plot class="distance-plot" [plot]="meanPlotData()" />
}
</mat-expansion-panel>
<!-- Parameter summary -->
<mat-expansion-panel expanded>
<mat-expansion-panel-header>
<mat-panel-title>Parameter Summary</mat-panel-title>
</mat-expansion-panel-header>
<mat-divider />
<app-parameter-summary />
</mat-expansion-panel>
<!-- App metadata -->
<mat-expansion-panel expanded>
<mat-expansion-panel-header>
<mat-panel-title>Application Metadata</mat-panel-title>
</mat-expansion-panel-header>
<mat-divider />
<nshmp-lib-ng-app-metadata [repositories]="repositories()" />
</mat-expansion-panel>
</mat-accordion>
</nshmp-lib-ng-plots-container>