From f64fe65ed602701f243e1a840120ff22274c777d Mon Sep 17 00:00:00 2001 From: Tim Herbst Date: Sat, 26 Dec 2020 16:26:27 +0100 Subject: [PATCH] rearrange dashboard-components --- .../app/dashboard/dashboard.component.html | 117 +++++++++++------- .../app/dashboard/dashboard.component.scss | 74 ++++++----- .../src/app/map/pop-up/pop-up.component.ts | 2 - .../src/app/service/dashboard.service.ts | 14 ++- 4 files changed, 124 insertions(+), 83 deletions(-) diff --git a/projects/project-3/frontend/src/app/dashboard/dashboard.component.html b/projects/project-3/frontend/src/app/dashboard/dashboard.component.html index 27d9598..595172c 100644 --- a/projects/project-3/frontend/src/app/dashboard/dashboard.component.html +++ b/projects/project-3/frontend/src/app/dashboard/dashboard.component.html @@ -1,60 +1,71 @@ - Bike Stations in London library_books - Wiki + Wiki + map - back to map + back to map + - - -
- - Enter a range - - - - - - - -
-
- -
-
- + + +
-
- -
+
+ + +
+ + Enter a range + + + + + + + +
+
+ +
+
+
+
+ + +
+ {{station?.commonName}} +
+ +
+
+
+ + +
+ +
-
-
+
+
@@ -75,9 +86,7 @@
station of lend destination
-
+
@@ -102,13 +111,12 @@
- - + + Borrow Duration -
+
+ [yaxis]="durationChartOptions.yaxis">
+
+ + + Borrow Time + + + +
+ +
+
+
+
diff --git a/projects/project-3/frontend/src/app/dashboard/dashboard.component.scss b/projects/project-3/frontend/src/app/dashboard/dashboard.component.scss index aaeabb7..f5fd85f 100644 --- a/projects/project-3/frontend/src/app/dashboard/dashboard.component.scss +++ b/projects/project-3/frontend/src/app/dashboard/dashboard.component.scss @@ -6,17 +6,7 @@ mat-sidenav-content { flex: 1 1 auto; } -.sidenav { - height: 100vh; - width: 15vw; - min-width: 20em; -} - -mat-sidenav-container, mat-sidenav-content, mat-sidenav { - height: 100vh; -} - -.button-back:hover { +.button-back:hover, .button-wiki:hover { background: #5a34a0; } @@ -24,18 +14,31 @@ mat-sidenav-container, mat-sidenav-content, mat-sidenav { padding: 10px; } -.button-wiki:hover { - background: #5a34a0; +.user-input { + height: 10em; } .datepicker { - margin-top: 100px; + margin-top: 2em; +} + +.submit-date { + padding-bottom: 2em; } .mat-card { padding: 1px 1px 1px; - margin: 2em; + margin: 10px; } + +.example-header-image { + margin-top: 1em; + margin-left: 1em; + margin-bottom: 1em; + background-image: url('../../assets/bike-point.png'); + background-size: cover; +} + .mat-card-map { padding: 1px; } @@ -44,36 +47,43 @@ mat-sidenav-container, mat-sidenav-content, mat-sidenav { margin-top: 1em; } -.mat-card-header { - display: flex; +.chart-header { + display: inline-flex; justify-content: center; } .container-map { - height: 40vh; + height: 40em; + margin: 1em 2em; } .container-table { - height: 20vh; -} - -.container-borrow-duration { - height: 40vh -} - -.container-bottom { - height: 30vh + height: 20em; + margin: 1em 3em; } .dashboard-table-to { - margin: 5px; + margin-right: 1em; } .dashboard-table-from { - margin: 5px; + margin-left: 1em; } -.dashboard-chart-borrow-time { - margin: 5px; - background: chartreuse; +.container-borrow-duration { + height: 40em; + margin: 1em 2em; +} + +.container-borrow-time { + height: 40em; + margin: 1em 2em; +} + +.station-dashboard-borrow-time { + margin: 1em; +} + +.station-dashboard-borrow-duration { + margin: 1em; } diff --git a/projects/project-3/frontend/src/app/map/pop-up/pop-up.component.ts b/projects/project-3/frontend/src/app/map/pop-up/pop-up.component.ts index 371813b..81e2469 100644 --- a/projects/project-3/frontend/src/app/map/pop-up/pop-up.component.ts +++ b/projects/project-3/frontend/src/app/map/pop-up/pop-up.component.ts @@ -40,6 +40,4 @@ export class PopUpComponent implements OnInit { public route(): void { this.router.navigate(['/dashboard', this.station.id]); } - - } diff --git a/projects/project-3/frontend/src/app/service/dashboard.service.ts b/projects/project-3/frontend/src/app/service/dashboard.service.ts index 39b0e92..567ac4b 100644 --- a/projects/project-3/frontend/src/app/service/dashboard.service.ts +++ b/projects/project-3/frontend/src/app/service/dashboard.service.ts @@ -15,14 +15,20 @@ export class DashboardService { } public async fetch_dashboard_station_to(id: string, startDate: string, endDate: string): Promise { - return await this.client.get(environment.apiUrl + `latest/dashboard/${id}/to?start_date=${startDate}&end_date=${endDate}`).toPromise(); + return await this.client.get( + environment.apiUrl + `latest/dashboard/${id}/to?start_date=${startDate}&end_date=${endDate}` + ).toPromise(); } public async fetch_dashboard_station_from(id: string, startDate: string, endDate: string): Promise { - return await this.client.get(environment.apiUrl + `latest/dashboard/${id}/from?start_date=${startDate}&end_date=${endDate}`).toPromise(); + return await this.client.get( + environment.apiUrl + `latest/dashboard/${id}/from?start_date=${startDate}&end_date=${endDate}` + ).toPromise(); } - public async fetch_dashboard_station_duration(id: string, startDate: string, endDate: string): Promise { - return await this.client.get(environment.apiUrl + `latest/dashboard/${id}/duration?start_date=${startDate}&end_date=${endDate}`).toPromise(); + public async fetch_dashboard_station_charts(id: string, startDate: string, endDate: string, type: string): Promise { + return await this.client.get( + environment.apiUrl + `latest/dashboard/${id}/${type}?start_date=${startDate}&end_date=${endDate}` + ).toPromise(); } }
station of lend origin