Skip to content
This repository has been archived by the owner on Mar 23, 2020. It is now read-only.

FOGL-3062: Update GUI to use new bucket API for asset graphs #551

Open
wants to merge 103 commits into
base: develop
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from 99 commits
Commits
Show all changes
103 commits
Select commit Hold shift + click to select a range
3d5e8c2
chart zoom facility integration
mshariq-nerd Oct 15, 2019
3062439
Merge remote-tracking branch 'origin' into FOGL-3062
mshariq-nerd Oct 15, 2019
3d6541b
scroll to zoom implementation
mshariq-nerd Oct 16, 2019
604cd13
Added bucket api call for asset graph
mshariq-nerd Oct 18, 2019
91b5904
Merge branch 'develop' into chart-zoom
mshariq-nerd Oct 21, 2019
944910b
Added pan drag functionality
mshariq-nerd Oct 21, 2019
a341df4
fixed graph load in manual ping
mshariq-nerd Oct 21, 2019
376f7fb
page scroll issue fix in modal
mshariq-nerd Oct 21, 2019
1f130c0
Merge branch 'develop' into chart-zoom
mshariq-nerd Oct 22, 2019
21d8bc3
added logs for zoom start and end time
mshariq-nerd Oct 22, 2019
437c616
Merge branch 'develop' into chart-zoom
mshariq-nerd Oct 25, 2019
a2e07af
conflicts resolved
mshariq-nerd Nov 6, 2019
ee26a1f
changed api call for multiple datapoints bucket
mshariq-nerd Nov 6, 2019
291be63
Fixed chart size issue on modal
mshariq-nerd Nov 7, 2019
aa5836f
removed extra logs
mshariq-nerd Nov 7, 2019
ca902ed
used button icon for reset graph and panning graph
mshariq-nerd Nov 8, 2019
023cd4e
Removed summary tab and other css changes
mshariq-nerd Nov 8, 2019
d07dc09
removed unused imports
mshariq-nerd Nov 8, 2019
b75902d
Merge remote-tracking branch 'origin' into chart-zoom
mshariq-nerd Nov 8, 2019
226bed2
Fixed timestamp issue for start param
mshariq-nerd Nov 11, 2019
65d2cfe
fixed _dragZoomEnd undefine issue
mshariq-nerd Nov 12, 2019
4b922af
fix drag on zoom
mshariq-nerd Nov 12, 2019
82dd239
Changed Graph hover icon
mshariq-nerd Nov 12, 2019
36da8fd
Added chart zoom lib in developers guide
mshariq-nerd Nov 12, 2019
13f41ef
Fixed auto refresh issue
mshariq-nerd Nov 13, 2019
59cae9f
Fixed panning and zooming issue
mshariq-nerd Nov 13, 2019
ac1a3a2
Fixed panning while zooming
mshariq-nerd Nov 14, 2019
8cefd9c
Fixed drag issue
mshariq-nerd Nov 14, 2019
70c7bbc
conflict resolved
mshariq-nerd Dec 3, 2019
7f656fc
Merge branch 'develop' into chart-zoom
mshariq-nerd Dec 3, 2019
6016798
Merge branch 'develop' into chart-zoom
mshariq-nerd Dec 3, 2019
9dfc45c
Asset graph using plotly.js
mshariq-nerd Dec 5, 2019
0133a02
Fixed timezone issue
mshariq-nerd Dec 5, 2019
1e77b42
Fixed start, until logic
mshariq-nerd Dec 5, 2019
5f51b9f
Removed extra dependency
mshariq-nerd Dec 5, 2019
8eb6fe7
Added zoom-in/out click event
mshariq-nerd Dec 6, 2019
dc30d6a
Chart panning - WIP
mshariq-nerd Dec 6, 2019
c4ddecb
allow console logs in prod mode - temporarily
mshariq-nerd Dec 6, 2019
c582bc9
Fixed wrong start time issue
mshariq-nerd Dec 9, 2019
b908975
changed time window from array to enum
mshariq-nerd Dec 10, 2019
7709aad
removed commented code
mshariq-nerd Dec 10, 2019
658414b
Fixed zoom out window size issue
mshariq-nerd Dec 11, 2019
7a9f2c7
Change made for zoom functionality
mshariq-nerd Dec 11, 2019
cfb15fa
Merge remote-tracking branch 'origin' into FOGL-3062
mshariq-nerd Dec 11, 2019
6a13463
Removed title
mshariq-nerd Dec 11, 2019
2060f96
Fixed zoom-out window issue
mshariq-nerd Dec 12, 2019
e14b5c9
removed extra logs
mshariq-nerd Dec 12, 2019
0d51dde
preserved legend state on graph refresh
MonikaSharma06 Dec 13, 2019
5f6debe
reset legend state on graph reset event
MonikaSharma06 Dec 13, 2019
3c53b51
Merge pull request #553 from foglamp/FOGL-3535
mshariq-nerd Dec 13, 2019
db60ebb
Fixed legend click issue
mshariq-nerd Dec 13, 2019
b56ff5c
Fixed data issue on default window time, future drag
mshariq-nerd Dec 13, 2019
61e755d
x axis most recent time issue i.e. graphStartTimeSeconds
praveen-garg Dec 13, 2019
381de57
Removed FOGL-3516 TODO comment and fixed local statrt time issue
mshariq-nerd Dec 16, 2019
86816b6
Fixed date format
mshariq-nerd Dec 16, 2019
da02380
show tickrange on x-axis accordingly
MonikaSharma06 Dec 17, 2019
ca67caa
removed logs
MonikaSharma06 Dec 17, 2019
8be91d2
Added pan and zoom-in, zoom-out in pan mode functionality
mshariq-nerd Dec 17, 2019
4bf6ff7
changes in x-axis range to show time format
MonikaSharma06 Dec 18, 2019
8165ec4
Merge branch 'FOGL-3062' into FOGL-3062.tickrange
MonikaSharma06 Dec 18, 2019
df4e6f0
fixed tickformat issue
MonikaSharma06 Dec 19, 2019
f07aec6
feedback changes
MonikaSharma06 Dec 19, 2019
7f82836
refactoring in code
MonikaSharma06 Dec 19, 2019
2578c39
changes as per feedback
MonikaSharma06 Dec 19, 2019
233a059
change in comment
MonikaSharma06 Dec 19, 2019
5de4155
Merge pull request #555 from foglamp/FOGL-3062patch
mshariq-nerd Dec 20, 2019
dbea4ff
Merge pull request #554 from foglamp/FOGL-3062.tickrange
mshariq-nerd Dec 20, 2019
bc500a3
Marker for single reading and zoom index issue fixed
mshariq-nerd Dec 20, 2019
3736430
Fixed zoom in issue in pan mode
mshariq-nerd Dec 20, 2019
1e3b4e8
added plotly graph on dashboard
MonikaSharma06 Dec 23, 2019
95cc529
removed chart.js
MonikaSharma06 Dec 23, 2019
2ed7cbe
Fixed x-axis update issue
mshariq-nerd Dec 23, 2019
bb5dd7a
Fixed zoom in issue in case of single reading
mshariq-nerd Dec 23, 2019
43c700d
Merge branch 'FOGL-3062' into FOGL-3545
MonikaSharma06 Dec 23, 2019
9a9811a
minor changes
MonikaSharma06 Dec 23, 2019
917aad0
Merge pull request #556 from foglamp/FOGL-3545
mshariq-nerd Dec 23, 2019
4e0e496
Fixed issue in preparing readings data for multiple keys on graph
mshariq-nerd Dec 24, 2019
3880e1c
Fixed timestamp issue in case of empty reading
mshariq-nerd Dec 24, 2019
64a0ca7
Fixed timestamp issue for old readings case
mshariq-nerd Dec 24, 2019
590fa62
Fixed timezone issue for x-axis range
mshariq-nerd Dec 26, 2019
4d0c6fe
Merge branch 'develop' into FOGL-3062
mshariq-nerd Dec 27, 2019
a498d42
Merge branch 'develop' into FOGL-3062
mshariq-nerd Dec 27, 2019
631e5fc
changed rangemode of graph on dasboard
MonikaSharma06 Dec 30, 2019
4ad9c29
Fixed x-axis range issue on drag graph
mshariq-nerd Dec 30, 2019
e0c4bda
fixed empty reading issue
mshariq-nerd Dec 30, 2019
05d3f47
fixed empty reading issue
mshariq-nerd Dec 30, 2019
94c515e
changes as per feedback
MonikaSharma06 Dec 30, 2019
1736010
removed unwanted code
MonikaSharma06 Dec 31, 2019
f6d62c6
Merge pull request #559 from foglamp/FOGL-3062_rangemode
mshariq-nerd Dec 31, 2019
c91d8db
fixed range issue in drag mode
mshariq-nerd Jan 2, 2020
9bb6d69
Merge branch 'FOGL-3062' into FOGL-3062.patch
mshariq-nerd Jan 2, 2020
7cc0009
removed extra logs
mshariq-nerd Jan 2, 2020
9fa4495
Merge branch 'develop' into FOGL-3062
mshariq-nerd Jan 2, 2020
913766b
Merge branch 'develop' into FOGL-3062.patch
mshariq-nerd Jan 2, 2020
c79eef4
Merge branch 'FOGL-3062' into FOGL-3062.patch
mshariq-nerd Jan 2, 2020
14b884e
changed date format
mshariq-nerd Jan 2, 2020
ad499d9
Removed extra subscription when drag to future
mshariq-nerd Jan 3, 2020
910b8b6
conflicts resolved
mshariq-nerd Jan 6, 2020
f5506c8
Merge branch 'develop' into FOGL-3062
mshariq-nerd Jan 6, 2020
fb2fb85
Minor feedback fixes
mshariq-nerd Jan 7, 2020
81b00b8
Merge branch 'develop' into FOGL-3062
mshariq-nerd Jan 16, 2020
f3d2410
Merge branch 'develop' into FOGL-3062
mshariq-nerd Jan 20, 2020
2c50523
Resolved conflicts
mshariq-nerd Jan 21, 2020
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
4 changes: 1 addition & 3 deletions angular.json
Original file line number Diff line number Diff line change
Expand Up @@ -32,9 +32,7 @@
"src/assets/css/bulma-steps.min.css",
"src/styles.css"
],
"scripts": [
"./node_modules/plotly.js/dist/plotly.js"
]
"scripts": []
},
"configurations": {
"production": {
Expand Down
7 changes: 3 additions & 4 deletions docs/developers-guide.md
Original file line number Diff line number Diff line change
Expand Up @@ -79,16 +79,15 @@ Set API base URL in `environments/environment.prod.ts`, you can always change it
#### Core
Library | Version | Latest Stable (? Y/n) | License
------------- | ------------- | -------------------- | ------------
Angular | 8.2.12 | 8.2.12 | MIT
Angular CLI | 8.3.14 | 8.3.14 | MIT
Angular | 8.2.12 | 8.2.12 | MIT
Angular CLI | 8.3.14 | 8.3.14 | MIT
TypeScript | 3.5.3 | 3.6.3 | Apache 2.0
rxjs | 6.5.2 | 6.5.2 | Apache 2.0
Bulma css | 0.7.5 | 0.7.5 | MIT

#### Dev
Library | Version | Latest Stable (? Y/n) | License
---------------- | ------------- | -------------------- | ------------
chart.js | 2.8.0 | 2.8.0 | MIT
core-js | 3.3.3 | 3.3.3 | MIT
ng-sidebar | 8.0.0 | 8.0.0 | MIT
moment | 2.24.0 | 2.24.0 | MIT
Expand Down
2 changes: 1 addition & 1 deletion package.json
Original file line number Diff line number Diff line change
Expand Up @@ -29,9 +29,9 @@
"@ctrl/ngx-codemirror": "^2.2.0",
"@ng-select/ng-select": "^3.3.0",
"@ngx-progressbar/core": "^5.3.2",
"angular-plotly.js": "^1.4.2",
"angular-tree-component": "~8.4.0",
"animate.css": "^3.7.2",
"chart.js": "~2.8.0",
"codemirror": "^5.49.2",
"core-js": "^3.3.3",
"jsonlint-mod": "^1.7.5",
Expand Down
25 changes: 0 additions & 25 deletions src/app/components/common/chart/chart.component.spec.ts

This file was deleted.

37 changes: 0 additions & 37 deletions src/app/components/common/chart/chart.component.ts

This file was deleted.

11 changes: 0 additions & 11 deletions src/app/components/common/chart/chart.module.ts

This file was deleted.

2 changes: 0 additions & 2 deletions src/app/components/common/chart/index.ts

This file was deleted.

8 changes: 6 additions & 2 deletions src/app/components/core/asset-readings/assets.module.ts
Original file line number Diff line number Diff line change
Expand Up @@ -6,12 +6,16 @@ import { RouterModule, Routes } from '@angular/router';
import { AuthCheckGuard } from '../../../guards';
import { PipesModule } from '../../../pipes/pipes.module';
import { AssetsService } from '../../../services';
import { ChartModule } from '../../common/chart';
import { NumberInputDebounceModule } from '../../common/number-input-debounce/number-input-debounce.module';
import { PaginationModule } from '../../common/pagination/pagination.module';
import { ReadingsGraphComponent } from '../asset-readings/readings-graph/readings-graph.component';
import { AssetsComponent } from './assets/assets.component';

import * as PlotlyJS from 'plotly.js/dist/plotly.js';
import { PlotlyModule } from 'angular-plotly.js';

PlotlyModule.plotlyjs = PlotlyJS;

const routes: Routes = [
{
path: '',
Expand All @@ -31,7 +35,7 @@ const routes: Routes = [
CommonModule,
RouterModule.forChild(routes),
PipesModule,
ChartModule,
PlotlyModule,
NumberInputDebounceModule,
PaginationModule
],
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -8,60 +8,10 @@
padding: 15px !important;
}

.modal-card-body {
padding: 15px !important;
}

@media screen and (min-width: 769px) {
.modal-card {
width: 85%;
}
:host ::ng-deep .chart-container canvas[style] {
height: calc(100vh - 181px) !important;
}

:host ::ng-deep .svg-container {
height: calc(100vh - 181px) !important;
}
}

@media screen and (max-width: 769px) {
.chart-container {
position: relative;
width: 736px;
height: 397px;
}
.summary {
width: 736px;
}
}

.summary,
.summary .table {
background-color: #F8F9F9;
border-radius: 5px;
}

.is-info {
background-color: #85C1E9 !important;
}

table.is-borderless tr a {
padding-left: 0;
}

table.is-borderless td,
table.is-borderless tr {
border: 0 !important;
vertical-align: middle;
}

tbody {
line-height: 0.5;
}

.data-table {
width: 100%;
}

.app-loading {
Expand Down
Original file line number Diff line number Diff line change
@@ -1,14 +1,14 @@
<div id="chart_modal" class="modal">
<div class="modal-background"></div>
<div class="modal-card animated fadeIn" [ngClass]="{overflow: timeDropDownOpened}">
<div class="modal-card animated fadeIn">
<header class="modal-card-head">
<p class="modal-card-title is-size-5">{{assetCode}}
</p>
<div class="close">
<button class="delete" aria-label="close" (click)="toggleModal(false);loadPage = false"></button>
</div>
</header>
<section class="modal-card-body" [ngClass]="{overflow: timeDropDownOpened}">
<section class="modal-card-body">
<ng-container *ngIf="loadPage; else tabs">
<div class="app-loading">
&nbsp;
Expand All @@ -18,164 +18,8 @@
</div>
</ng-container>
<ng-template #tabs>
<div class="columns">
<div class="column is-2">
<div id="time-dropdown" class="dropdown is-left">
<div class="dropdown-trigger">
<button class="button is-small" aria-haspopup="true" aria-controls="dropdown-menu"
(click)=toggleDropdown()>
<span *ngIf="optedTime == 60">1 minute</span>
<span *ngIf="optedTime == 300">5 minutes</span>
<span *ngIf="optedTime == 600">10 minutes</span>
<span *ngIf="optedTime == 1800">30 minutes</span>
<span *ngIf="optedTime == 3600">1 hour</span>
<span *ngIf="optedTime == 28800">8 hour</span>
<span *ngIf="optedTime == 86400">1 day</span>
<span class="icon is-small">
<i class="fa fa-angle-down" aria-hidden="true"></i>
</span>
</button>
</div>
<div class="dropdown-menu" id="dropdown-menu" role="menu">
<div class="dropdown-content">
<a class="dropdown-item" (click)="getTimeBasedAssetReadingsAndSummary(60)">1 minute</a>
<a class="dropdown-item" (click)="getTimeBasedAssetReadingsAndSummary(300)">5 minutes</a>
<a class="dropdown-item" (click)="getTimeBasedAssetReadingsAndSummary(600)">10 minutes</a>
<a class="dropdown-item" (click)="getTimeBasedAssetReadingsAndSummary(1800)">30 minutes</a>
<a class="dropdown-item" (click)="getTimeBasedAssetReadingsAndSummary(3600)">1 hour</a>
<a class="dropdown-item" (click)="getTimeBasedAssetReadingsAndSummary(28800)">8 hour</a>
<a class="dropdown-item" (click)="getTimeBasedAssetReadingsAndSummary(86400)">1 day</a>
</div>
</div>
</div>
</div>
<div class="column">
<div class="tabs is-boxed is-fullwidth is-small" id="tabs">
<ul>
<li *ngIf="numberTypeReadingsList?.length > 0" [ngClass]="{'is-active': selectedTab == 1}" data-tab="1">
<a (click)="selectTab(1)">
<span><b>Graph</b></span>
</a>
</li>
<li *ngIf="arrayTypeReadingsList?.length > 0" [ngClass]="{'is-active': selectedTab == 2}" data-tab="2">
<a (click)="selectTab(2)">
<span><b>3D Graph</b></span>
</a>
</li>
<li *ngIf="!isEmptyObject(stringTypeReadingsList)" [ngClass]="{'is-active': selectedTab == 3}"
data-tab="3">
<a (click)="selectTab(3)">
<span><b>Tabular Data</b></span>
</a>
</li>
<li *ngIf="showSummaryTab()" [ngClass]="{'is-active': selectedTab == 4}" data-tab="4">
<a (click)="selectTab(4)">
<span><b>Summary</b></span>
</a>
</li>
</ul>
</div>
</div>
</div>
<div class="columns">
<div class="column">
<div id="tab-content">
<ng-container *ngIf="showSpinner; else DataDiv">
<div class="app-loading">
&nbsp;
<svg class="spinner animated fadeIn fadeOut" viewBox="0 0 100 100">
<circle class="path" cx="50%" cy="50%" r="10" fill="none" stroke-width="2" stroke-miterlimit="10" />
</svg>
</div>
</ng-container>
<ng-template #DataDiv>
<div *ngIf="selectedTab === 1 && numberTypeReadingsList?.length > 0" class="is-active" data-content="1">
<app-chart *ngIf="!showGraphSpinner" class="chart-container animated fadeIn" [type]="assetChartType"
[data]="assetReadingValues" [options]="assetChartOptions" #assetChart></app-chart>
</div>
<div *ngIf="selectedTab === 2 && arrayTypeReadingsList?.length > 0" data-content="2">
<div id="3d_graph" #3DGraph></div>
</div>
<div *ngIf="selectedTab === 3 && !isEmptyObject(stringTypeReadingsList)" data-content="3">
<table class="table is-responsive is-borderless data-table">
<thead>
<tr>
<th style="width: 21%">Timestamp</th>
<th>Reading</th>
</tr>
</thead>
<tbody>
<tr *ngFor="let txtData of stringTypeReadingsList | keyvalue: keyDescOrder">
<td style="vertical-align: top; line-height: initial">
<small>{{txtData.key}}</small>
</td>
<td>
<table class="table is-responsive is-borderless">
<tbody>
<ng-container *ngFor="let item of txtData.value">
<tr>
<td style="padding-left: 0px">{{item.key}}</td>
<td style="padding-left: 0px">{{item.data}}</td>
</tr>
</ng-container>
</tbody>
</table>

</td>
</tr>
</tbody>
</table>
</div>
<div *ngIf="selectedTab === 4 && assetReadingSummary?.length > 0 && showSummaryTab() " data-content="4">
<div [ngClass]="{'summary': buttonText !== ''}" class="animated fadeIn" *ngIf="!showSummarySpinner">
<table class="table is-responsive is-borderless data-table">
<tbody>
<tr [ngClass]="{'animated fadeInDown': autoRefresh === false}"
*ngFor="let asset of assetReadingSummary | slice:0:summaryLimit">
<td>
<span>
<b><small>{{asset.name}}</small></b>
</span>
</td>
<ng-container *ngFor="let reading of asset.value">
<td>
<div class="tags has-addons">
<span class="tag is-light"> Avg </span>
<span class="tag is-info">{{isNumber(reading.average)
?
roundTo(reading.average,
5) : reading.average.toString().substring(0,6)}}
</span>
</div>
</td>
<td>
<div class="tags has-addons">
<span class="tag is-light"> Min </span>
<span class="tag is-info">{{isNumber(reading.min) ?
roundTo(reading.min, 5) : reading.min.toString().substring(0,6)}}</span>
</div>
</td>
<td>
<div class="tags has-addons">
<span class="tag is-light"> Max </span>
<span class="tag is-info">{{isNumber(reading.max) ?
roundTo(reading.max, 5): reading.max.toString().substring(0,6)}}</span>
</div>
</td>
</ng-container>
</tr>
<tr *ngIf="buttonText !== ''">
<td><a class="button is-small is-text" (click)="showAll()">{{buttonText}}</a></td>
<td></td>
</tr>
</tbody>
</table>
</div>
</div>
</ng-template>
</div>
</div>
</div>
<plotly-plot #assetChart (relayout)="dragGraph($event)" (afterPlot)="calculateDragTime()" (legendClick)="legendClick($event)"
[data]="numReadings" [layout]="layout" [config]="config"></plotly-plot>
</ng-template>
</section>
</div>
Expand Down
Loading