import { ChangeDetectionStrategy , Component , Input , OnInit } from '@angular/core' ; import { Event } from '../../event' ; param event param link @ Component ( { changeDetection : ChangeDetectionStrategy . OnPush , selector : 'executive-nearby-seismicity-pin' , styleUrls : [ './nearby-seismicity-pin.component.scss' ] , templateUrl : './nearby-seismicity-pin.component.html' } ) export class NearbySeismicityPinComponent implements OnInit { @ Input ( ) event : Event ; footer = 'ANSS Comcat' ; @ Input ( ) link : string ; minimumMag ; title = 'View Nearby Seismicity' ; param magnitude return { number } getMinimumMag ( magnitude ) { return Math . max ( Math . floor ( magnitude ) - 3 , 1 ) ; } ngOnInit ( ) { this . minimumMag = this . getMinimumMag ( this . event . properties . mag || 3 ) ; } }