-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Browse files
Browse the repository at this point in the history
…ta-graph-caption #72-graph-data-graph-caption
- Loading branch information
Showing
24 changed files
with
244 additions
and
49 deletions.
There are no files selected for viewing
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,10 @@ | ||
import { urls } from './urls'; | ||
|
||
/** | ||
* Fetches the run with the given id | ||
* @param id The id of the run to request | ||
* @returns The requested run | ||
*/ | ||
export const getRunById = (id: number) => { | ||
return fetch(urls.getRunById(id)); | ||
}; |
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
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,4 +1,4 @@ | ||
<landing-page *ngIf="showLandingPage; else elseBlock" [storage]="storage" /> | ||
<ng-template #elseBlock> | ||
<graph-page [serverService]="serverService" [storage]="storage" /> | ||
<graph-page [realTime]="true" [serverService]="serverService" [storage]="storage" [runId]="1" /> | ||
</ng-template> |
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
21 changes: 21 additions & 0 deletions
21
angular-client/src/pages/graph-page/graph-caption/graph-caption.component.css
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,21 @@ | ||
.info-container { | ||
font: small-caption; | ||
width: 100%; | ||
bottom: 0; | ||
background-color: #323232; | ||
border-radius: 10px; | ||
display: flex; | ||
flex-direction: row; | ||
justify-content: space-between; | ||
color: #ffffff; | ||
padding-right: 8px; | ||
padding-left: 8px; | ||
} | ||
|
||
.left-info { | ||
text-align: left; | ||
} | ||
|
||
.right-info { | ||
text-align: right; | ||
} |
20 changes: 20 additions & 0 deletions
20
angular-client/src/pages/graph-page/graph-caption/graph-caption.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 |
---|---|---|
@@ -0,0 +1,20 @@ | ||
<div class="info-container"> | ||
<div class="left-info"> | ||
<div *ngIf="dataTypeName && dataTypeUnit; else elseBlock"> | ||
<typography variant="header" [content]="dataTypeName" /> | ||
<typography variant="subheader" [content]="value + ' ' + dataTypeUnit" /> | ||
</div> | ||
<ng-template #elseBlock> | ||
<typography variant="header" content="No Data Selected" /> | ||
</ng-template> | ||
</div> | ||
<div class="right-info"> | ||
<div class="driver-info"> | ||
<typography variant="header" [content]="currentDriver ?? 'No Driver Selected'" /> | ||
</div> | ||
<div class="system-info"> | ||
<typography variant="subheader" [content]="currentSystem ?? 'No System Selected'" /> | ||
<typography variant="subheader" [content]="currentLocation ?? 'No Location Selected'" /> | ||
</div> | ||
</div> | ||
</div> |
30 changes: 30 additions & 0 deletions
30
angular-client/src/pages/graph-page/graph-caption/graph-caption.component.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,30 @@ | ||
import { Component, Input } from '@angular/core'; | ||
import { Subject } from 'rxjs'; | ||
import { DataValue } from 'src/utils/socket.utils'; | ||
import { DataType } from 'src/utils/types.utils'; | ||
|
||
@Component({ | ||
selector: 'graph-caption', | ||
styleUrls: ['./graph-caption.component.css'], | ||
templateUrl: './graph-caption.component.html' | ||
}) | ||
export default class GraphInfo { | ||
@Input() dataType!: Subject<DataType>; | ||
@Input() currentValue!: Subject<DataValue | undefined>; | ||
@Input() currentDriver?: string; | ||
@Input() currentSystem?: string; | ||
@Input() currentLocation?: string; | ||
dataTypeName?: string; | ||
dataTypeUnit?: string; | ||
value?: string | number; | ||
|
||
ngOnInit(): void { | ||
this.dataType.subscribe((dataType: DataType) => { | ||
this.dataTypeName = dataType.name; | ||
this.dataTypeUnit = dataType.unit; | ||
}); | ||
this.currentValue.subscribe((value?: DataValue) => { | ||
this.value = value?.value ?? 'No Values'; | ||
}); | ||
} | ||
} |
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
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
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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,3 +1,4 @@ | ||
:host { | ||
#chart-container { | ||
width: 100%; | ||
height: 100%; | ||
} |
11 changes: 1 addition & 10 deletions
11
angular-client/src/pages/graph-page/graph/graph.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,10 +1 @@ | ||
<apx-chart | ||
[series]="options.series" | ||
[chart]="options.chart" | ||
[xaxis]="options.xaxis" | ||
[dataLabels]="options.dataLabels" | ||
[markers]="options.markers" | ||
[tooltip]="options.tooltip" | ||
[fill]="options.fill" | ||
[grid]="options.grid" | ||
/> | ||
<div id="chart-container"></div> |
Oops, something went wrong.