import { GraphPointModel } from "../../../shared/models/graphs/graph-point.model" ; import { MarkerModel } from "../../../fitness-trend/fitness-trend-graph/models/marker.model" ; import * as _ from "lodash" ; import * as MG from "metrics-graphics" ; import { Moment } from "moment" ; export class ViewableYearProgressDataModel { public yearLines : GraphPointModel [ ] [ ] = [ ] ; public targetLine : GraphPointModel [ ] = [ ] ; public markers : MarkerModel [ ] = [ ] ; public markerMoment : Moment ; constructor ( ) { this . markerMoment = null ; } public setGraphicsYearLines ( yearLines ) { this . yearLines = [ ] ; _ . forEach ( yearLines , ( yearLine ) => { this . yearLines . push ( MG . convert . date ( yearLine , "date" ) ) ; } ) ; } public setGraphicsTargetLine ( targetLine ) { this . targetLine = MG . convert . date ( targetLine , "date" ) ; } public setMarkerMoment ( markerMoment ) { this . markerMoment = markerMoment ; this . markers = [ { date : markerMoment . toDate ( ) , label : markerMoment . format ( "MMM Do" ) } ] ; } public getMarkerMoment ( ) { return this . markerMoment ; } }