-
Notifications
You must be signed in to change notification settings - Fork 25
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge pull request #318 from iteratec/feature/timeseriesChart
Feature/timeseries chart
- Loading branch information
Showing
17 changed files
with
681 additions
and
124 deletions.
There are no files selected for viewing
16 changes: 15 additions & 1 deletion
16
...dules/time-series/components/time-series-line-chart/time-series-line-chart.component.html
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,5 +1,19 @@ | ||
<div class="time-series-line-chart-container"> | ||
<div class="card"> | ||
<svg #svg /> | ||
<svg #svg/> | ||
</div> | ||
</div> | ||
|
||
<ngx-smart-modal id="pointSelectionErrorModal" identifier="pointSelectionErrorModal"> | ||
<header> | ||
<h2>{{ "frontend.de.iteratec.chart.errorHeader" | translate }}</h2> | ||
</header> | ||
<main> | ||
<div>{{ "frontend.de.iteratec.chart.datapointSelection.error.multipleServer" | translate }}</div> | ||
</main> | ||
<footer> | ||
<button (click)="this.ngxSmartModalService.close('pointSelectionErrorModal')" class="btn btn-default"> | ||
{{ "frontend.default.button.cancel.label" | translate }} | ||
</button> | ||
</footer> | ||
</ngx-smart-modal> |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
5 changes: 5 additions & 0 deletions
5
frontend/src/app/modules/time-series/models/event-result-point.model.ts
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,17 +1,22 @@ | ||
import {WptInfo} from "./wpt-info.model"; | ||
|
||
export interface EventResultPointDTO { | ||
date: Date; | ||
value: number; | ||
agent: string; | ||
wptInfo: WptInfo; | ||
} | ||
|
||
export class EventResultPoint implements EventResultPointDTO { | ||
date: Date; | ||
value: number; | ||
agent: string; | ||
wptInfo: WptInfo; | ||
|
||
constructor(dto: EventResultPointDTO) { | ||
this.date = dto.date; | ||
this.value = dto.value; | ||
this.agent = dto.agent; | ||
this.wptInfo = dto.wptInfo; | ||
} | ||
} |
37 changes: 37 additions & 0 deletions
37
frontend/src/app/modules/time-series/models/points-selection.model.ts
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,37 @@ | ||
import {TimeSeriesPoint} from "./time-series-point.model"; | ||
|
||
export class PointsSelection { | ||
|
||
private selectedPoints: TimeSeriesPoint[] = []; | ||
|
||
public unselectAll() { | ||
this.selectedPoints = []; | ||
} | ||
|
||
public selectPoint(pointToSelect: TimeSeriesPoint) { | ||
this.selectedPoints.push(pointToSelect); | ||
} | ||
|
||
public isPointSelected(pointToCheck: TimeSeriesPoint): boolean { | ||
return this.selectedPoints.some(elem => elem.equals(pointToCheck)); | ||
} | ||
|
||
public unselectPoint(pointToSelect: TimeSeriesPoint) { | ||
this.selectedPoints = this.selectedPoints.filter(elem => !elem.equals(pointToSelect)) | ||
} | ||
|
||
public count(): number { | ||
return this.selectedPoints.length; | ||
} | ||
|
||
public getAll(): TimeSeriesPoint[] { | ||
return this.selectedPoints; | ||
} | ||
|
||
public getFirst(): TimeSeriesPoint { | ||
if(this.count() === 0) { | ||
return null; | ||
} | ||
return this.selectedPoints[0]; | ||
} | ||
} |
7 changes: 7 additions & 0 deletions
7
frontend/src/app/modules/time-series/models/time-series-point.model.ts
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,10 +1,17 @@ | ||
/** | ||
* Representation of one point on the y-axis (value) with additional informations. | ||
*/ | ||
import {WptInfo} from "./wpt-info.model"; | ||
|
||
export class TimeSeriesPoint { | ||
date: Date; | ||
value: number; | ||
tooltipText: string; | ||
wptInfo: WptInfo; | ||
|
||
constructor() {} | ||
|
||
public equals(other: TimeSeriesPoint) { | ||
return other && this.date.getTime() == other.date.getTime() && this.tooltipText == other.tooltipText && this.value == other.value; | ||
} | ||
} |
6 changes: 6 additions & 0 deletions
6
frontend/src/app/modules/time-series/models/wpt-info.model.ts
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,6 @@ | ||
export class WptInfo { | ||
baseUrl: string; | ||
testId: string; | ||
runNumber: number; | ||
indexInJourney: number; | ||
} |
Oops, something went wrong.