Hazard Library

Home - NSHMP Angular Library User Guide

Common components, interfaces, services, NGRX state, and utilities for hazard applications.

Contents

Components

Component Module

Example :
import {NshmpHazardModule} from '@ghsc/nshmp-lib-ng/hazard';

@NgModule({
  declarations: [],
  imports: [NshmpHazardModule],
})
export class MyApplicationModule {}

Disaggregation Plot

Plot disaggregation using the disagg-d3 graphing library.

See DisaggPlotComponent for input parameters.

To use import NshmpHazardModule

Example :
<nshmp-lib-ng-hazard-disagg-plot></nshmp-lib-ng-hazard-disagg-plot>

Control Forms

Hazard control form components for the control panel.

To use any of the hazard control form components import NshmpHazardModule

Location

Latitude or longitude input form.

See LocationFormComponent for input parameters.

Example :
<nshmp-lib-ng-hazard-location-form></nshmp-lib-ng-hazard-location-form>

Max Direction

Max direction checkbox.

See MaxDirectionFormComponent for input parameters.

Example :
<nshmp-lib-ng-hazard-max-direction-form></nshmp-lib-ng-hazard-max-direction-form>

Model

Select menu of NSHMs.

See ModelFormComponent for input parameters.

Example :
<nshmp-lib-ng-hazard-model-form></nshmp-lib-ng-hazard-model-form>

Return Period

Input and select menu for return periods.

See ReturnPeriodFormComponent for input parameters.

Example :
<nshmp-lib-ng-hazard-return-period-form></nshmp-lib-ng-hazard-return-period-form>

Site Class

Select menu for site classes.

See SiteClassFormComponent for input parameters.

Example :
<nshmp-lib-ng-hazard-site-class-form></nshmp-lib-ng-hazard-site-class-form>

Trunction

Truncation checkbox.

See TruncationFormComponent for input parameters.

Example :
<nshmp-lib-ng-hazard-truncation-form></nshmp-lib-ng-hazard-truncation-form>

Vs30

Vs30 input form field.

See Vs30FormComponent for input parameters.

Example :
<nshmp-lib-ng-hazard-vs30-form></nshmp-lib-ng-hazard-vs30-form>

Code scaffolding

Run npm run ng -- generate component component-name --project=nshmp-lib-ng-hazard to generate a new component.

Can also use npm run ng -- generate directive|pipe|service|class|guard|interface|enum|module --project=nshmp-lib-ng-hazard.

Note: Don't forget to add --project=nshmp-lib-ng-hazard or else it will be added to the default project in the angular.json file.

Running unit tests

Run npm run test -- projects/nshmp-lib-ng/hazard to execute the unit tests.

Further help

To get more help on the Angular CLI use npm run ng -- help or go check out the Angular CLI Overview and Command Reference page.

results matching ""

    No results matching ""