File

components/plots/plots.component.ts

Description

Ground motion vs distance Ploty plot with parameter summary.

Metadata

Index

Properties

Constructor

constructor(service: AppService)
Parameters :
Name Type Optional
service AppService No

Properties

meanPlotData
Default value : computed(() => this.service.meanPlotState()?.plotData)

GM vs distance plot data

repositories
Default value : computed(() => this.service.usage()?.metadata.repositories)

Repo metadata

Public service
Type : AppService
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>
Legend
Html element
Component
Html element with directive

results matching ""

    No results matching ""