God damn, it's responsive now!

This commit is contained in:
Marcel Schwarz 2021-01-03 04:18:00 +01:00
parent 52e68a4f28
commit c73d99bc51
13 changed files with 179 additions and 16515 deletions

File diff suppressed because it is too large Load Diff

View File

@ -23,13 +23,12 @@
"@angular/platform-browser-dynamic": "~10.2.0", "@angular/platform-browser-dynamic": "~10.2.0",
"@angular/router": "~10.2.0", "@angular/router": "~10.2.0",
"apexcharts": "^3.23.0", "apexcharts": "^3.23.0",
"bootstrap": "^3.4.1", "bootstrap": "^4.5.3",
"jquery": "^3.5.1", "jquery": "^3.5.1",
"leaflet": "~1.3.1", "leaflet": "~1.3.1",
"leaflet.heat": "^0.2.0", "leaflet.heat": "^0.2.0",
"leaflet.markercluster": "^1.4.1", "leaflet.markercluster": "^1.4.1",
"ng-apexcharts": "^1.5.6", "ng-apexcharts": "^1.5.6",
"popper.js": "^1.14.3",
"rxjs": "~6.6.0", "rxjs": "~6.6.0",
"seconds-to-human-time": "^1.0.0", "seconds-to-human-time": "^1.0.0",
"tslib": "^2.0.0", "tslib": "^2.0.0",

View File

@ -1,42 +1,36 @@
<meta content="width=device-width, initial-scale=1.0" name="viewport"> <meta content="width=device-width, initial-scale=1.0" name="viewport">
<mat-toolbar class="mat-toolbar" color="primary"> <mat-toolbar class="toolbar" color="primary">
<span routerLink="/">Bike Stations in London</span> <span routerLink="/">Bike Stations in London</span>
<span class="toolbar-spacer"></span> <span class="spacer"></span>
<a class="button-wiki" color="primary" <a color="primary"
href="https://gitlab.com/marcel.schwarz/geovisualisierung/-/wikis/Projektarbeit%203" mat-flat-button href="https://gitlab.com/marcel.schwarz/geovisualisierung/-/wikis/Projektarbeit%203"
mat-flat-button
target="_blank"> target="_blank">
<mat-icon>library_books</mat-icon> <mat-icon>library_books</mat-icon>
Wiki Wiki
</a> </a>
<a class="button-back" color="primary" <a color="primary" mat-flat-button routerLink="/">
mat-flat-button routerLink="/">
<mat-icon>map</mat-icon> <mat-icon>map</mat-icon>
back to map back to map
</a> </a>
</mat-toolbar> </mat-toolbar>
<mat-sidenav-container> <div class="px-5 py-3" style="background: #2f2f2f">
<mat-sidenav-content class="mat-sidenav-content" fxFlex fxLayout="column" fxLayoutAlign="center"> <div>
<div class="container-map" fxFlex="100%" fxLayout="row" fxLayoutAlign="center"> <div class="row mb-3">
<app-user-input (startEndDate)="onSubmit($event)" class="col-xl-5 col-lg-6 col-md-12 mb-md-3"></app-user-input>
<div class="input-container" fxFlex="35%" fxLayout="column"> <app-mini-map class="col-xl-7 col-lg-6 col-md-12"></app-mini-map>
<app-user-input
fxFlex
(startEndDate)="onSubmit($event)"
></app-user-input>
</div>
<app-mini-map fxFlex></app-mini-map>
</div> </div>
<div class="container-table" fxFlex fxLayout="row" fxLayoutAlign="space-evenly center"> <div class="mb-3">
<app-table fxFlex></app-table> <app-table></app-table>
</div> </div>
<div class="container-borrow-duration" fxLayout="row" fxLayoutAlign="center"> <div class="row mb-3">
<app-rent-duration-chart fxFlex></app-rent-duration-chart> <app-rent-duration-chart class="col"></app-rent-duration-chart>
</div> </div>
<div class="container-borrow-time" fxLayout="row" fxLayoutAlign="center"> <div class="row mb-3">
<app-rent-time-chart fxFlex></app-rent-time-chart> <app-rent-time-chart class="col"></app-rent-time-chart>
</div> </div>
</mat-sidenav-content> </div>
</mat-sidenav-container> </div>

View File

@ -1,74 +1,16 @@
mat-sidenav-content { .toolbar {
background: #2f2f2f; height: 5vh;
}
.toolbar-spacer { .toolbar-spacer {
flex: 1 1 auto; flex: 1 1 auto;
} }
.button-back:hover, .button-wiki:hover { a:hover {
background: #086ed2; background: #086ed2;
} text-decoration: none;
}
.submit-date { .spacer {
margin-top: 1em; flex: 1 1 auto;
margin-left: 4em; }
}
#chart {
margin-right: 16px;
}
.mat-card {
padding: 1px 1px 1px;
margin: 10px;
}
.example-header-image {
margin-top: 1em;
margin-left: 1em;
margin-bottom: 1em;
background-image: url('../../assets/bike-point-blue.png');
background-size: cover;
}
.mat-card-map {
padding: 1px;
}
.mat-card-title {
margin-top: 1em;
margin-left: 2em;
}
.mat-card-subtitle {
margin-left: 39px;
}
.container-map {
height: 40em;
margin: 1em 2em;
}
.container-table {
height: 20em;
margin: 1em 3em;
}
.container-borrow-duration {
height: 41em;
margin: 1em 2em;
}
.container-borrow-time {
height: 44em;
margin: 1em 2em;
}
.station-dashboard-borrow-time {
margin: 1em;
}
.station-dashboard-borrow-duration {
margin: 1em;
} }

View File

@ -1,7 +1,3 @@
<mat-card class="mat-card-map" fxFlex> <mat-card class="p-0">
<div class="mini-map" fxFlex> <div id="minimap" style="height: 30rem"></div>
<div class="map-frame" fxFill>
<div fxFill id="minimap"></div>
</div>
</div>
</mat-card> </mat-card>

View File

@ -1,4 +0,0 @@
.mat-card {
padding: 1px 1px 1px;
margin: 10px;
}

View File

@ -1,17 +0,0 @@
.station-dashboard-borrow-duration {
margin: 1em;
}
.mat-card {
padding: 1px 1px 1px;
margin: 10px;
}
.mat-card-title {
margin-top: 1em;
margin-left: 2em;
}
.mat-card-subtitle {
margin-left: 39px;
}

View File

@ -1,17 +0,0 @@
.station-dashboard-borrow-duration {
margin: 1em;
}
.mat-card {
padding: 1px 1px 1px;
margin: 10px;
}
.mat-card-title {
margin-top: 1em;
margin-left: 2em;
}
.mat-card-subtitle {
margin-left: 39px;
}

View File

@ -1,91 +1,88 @@
<div class="dashboard-table-to" fxFlex> <div class="row">
<table [dataSource]="stationToSource" class="mat-elevation-z8" fxFill mat-table> <div class="col-lg-6 col-md-12 mb-md-3">
<ng-container matColumnDef="select"> <table [dataSource]="stationToSource" class="mat-elevation-z0 w-100" mat-table>
<th *matHeaderCellDef mat-header-cell></th> <ng-container matColumnDef="select">
<td *matCellDef="let row" mat-cell> <th *matHeaderCellDef mat-header-cell></th>
<mat-checkbox [disabled]="isCheckBoxDisable(row)" <td *matCellDef="let row" class="p-3" mat-cell>
(change)="$event ? selectRow($event, row) : null" (click)="$event.stopPropagation()" <mat-checkbox (change)="$event ? selectRow($event, row) : null"
[checked]="selectionModel.isSelected(row)" (click)="$event.stopPropagation()"
matTooltip="toggle to view marker on map" [checked]="selectionModel.isSelected(row)"
matTooltipPosition="above"> [disabled]="isCheckBoxDisable(row)"
</mat-checkbox> matTooltip="toggle to view marker on map"
</td> matTooltipPosition="above">
</ng-container> </mat-checkbox>
<ng-container matColumnDef="endStationName"> </td>
<th *matHeaderCellDef mat-header-cell> station of rental destination</th> </ng-container>
<td *matCellDef="let element" mat-cell><a <ng-container matColumnDef="endStationName">
[routerLink]="['/dashboard/', element.stationId]">{{element.stationName}}</a></td> <th *matHeaderCellDef mat-header-cell> station of rental destination</th>
</ng-container> <td *matCellDef="let element" mat-cell>
<a [routerLink]="['/dashboard/', element.stationId]">{{element.stationName}}</a>
</td>
</ng-container>
<ng-container matColumnDef="number"> <ng-container matColumnDef="number">
<th *matHeaderCellDef mat-header-cell> number of drives</th> <th *matHeaderCellDef mat-header-cell> number of drives</th>
<td *matCellDef="let element" mat-cell> {{element.number}} </td> <td *matCellDef="let element" mat-cell> {{element.number}} </td>
</ng-container> </ng-container>
<ng-container matColumnDef="avgDuration"> <ng-container matColumnDef="avgDuration">
<th *matHeaderCellDef mat-header-cell> average rental duration</th> <th *matHeaderCellDef mat-header-cell> average rental duration</th>
<td *matCellDef="let element" mat-cell> {{humanizeAvgDuration(element.avgDuration)}} </td> <td *matCellDef="let element" mat-cell> {{humanizeAvgDuration(element.avgDuration)}} </td>
</ng-container> </ng-container>
<ng-container matColumnDef="marker"> <ng-container matColumnDef="marker">
<th *matHeaderCellDef mat-header-cell> icon on map</th> <th *matHeaderCellDef mat-header-cell> icon on map</th>
<td *matCellDef="let element" mat-cell><img [src]="drawIconInTable(element)" alt="marker"></td> <td *matCellDef="let element" mat-cell><img [src]="drawIconInTable(element)" alt="marker"></td>
</ng-container> </ng-container>
<tr *matHeaderRowDef="displayedColumnsTo" mat-header-row></tr> <tr *matHeaderRowDef="displayedColumnsTo" mat-header-row></tr>
<tr *matRowDef="let row; columns: displayedColumnsTo;" mat-row></tr> <tr *matRowDef="let row; columns: displayedColumnsTo;" mat-row></tr>
</table> </table>
<div *ngIf="isLoadingToSource" <div *ngIf="isLoadingToSource" class="col d-flex align-items-center justify-content-center">
style="display: flex; justify-content: center; align-items: center; background: white; padding: 10px"> <mat-progress-spinner color="primary" mode="indeterminate"></mat-progress-spinner>
<mat-progress-spinner </div>
color="primary" </div>
mode="indeterminate"> <div class="col-lg-6 col-md-12">
</mat-progress-spinner> <table [dataSource]="stationFromSource" class="mat-elevation-z0 w-100" mat-table>
<ng-container matColumnDef="select">
<th *matHeaderCellDef mat-header-cell></th>
<td *matCellDef="let row" class="p-3" mat-cell>
<mat-checkbox (change)="$event ? selectRow($event, row) : null"
(click)="$event.stopPropagation()"
[checked]="selectionModel.isSelected(row)"
[disabled]="isCheckBoxDisable(row)"
matTooltip="toggle to view marker on map"
matTooltipPosition="above">
</mat-checkbox>
</td>
</ng-container>
<ng-container matColumnDef="startStationName">
<th *matHeaderCellDef mat-header-cell> station of rental origin</th>
<td *matCellDef="let element" mat-cell>
<a [routerLink]="['/dashboard/', element.stationId]"> {{element.stationName}}</a>
</td>
</ng-container>
<ng-container matColumnDef="number">
<th *matHeaderCellDef mat-header-cell> number of drives</th>
<td *matCellDef="let element" mat-cell> {{element.number}} </td>
</ng-container>
<ng-container matColumnDef="avgDuration">
<th *matHeaderCellDef mat-header-cell> average rental duration</th>
<td *matCellDef="let element" mat-cell> {{humanizeAvgDuration(element.avgDuration)}} </td>
</ng-container>
<ng-container matColumnDef="marker">
<th *matHeaderCellDef mat-header-cell> icon on map</th>
<td *matCellDef="let element" mat-cell><img [src]="drawIconInTable(element)" alt="marker"></td>
</ng-container>
<tr *matHeaderRowDef="displayedColumnsFrom" mat-header-row></tr>
<tr *matRowDef="let row; columns: displayedColumnsFrom;" mat-row></tr>
</table>
<div *ngIf="isLoadingFromSource" class="col d-flex align-items-center justify-content-center">
<mat-progress-spinner color="primary" mode="indeterminate"></mat-progress-spinner>
</div>
</div> </div>
</div> </div>
<div class="dashboard-table-from" fxFlex>
<table [dataSource]="stationFromSource" class="mat-elevation-z9" fxFill mat-table>
<ng-container matColumnDef="select">
<th *matHeaderCellDef mat-header-cell></th>
<td *matCellDef="let row" mat-cell>
<mat-checkbox [disabled]="isCheckBoxDisable(row)"
(change)="$event ? selectRow($event, row) : null" (click)="$event.stopPropagation()"
[checked]="selectionModel.isSelected(row)"
matTooltip="toggle to view marker on map"
matTooltipPosition="above">
</mat-checkbox>
</td>
</ng-container>
<ng-container matColumnDef="startStationName">
<th *matHeaderCellDef mat-header-cell> station of rental origin</th>
<td *matCellDef="let element" mat-cell><a
[routerLink]="['/dashboard/', element.stationId]"> {{element.stationName}}</a></td>
</ng-container>
<ng-container matColumnDef="number">
<th *matHeaderCellDef mat-header-cell> number of drives</th>
<td *matCellDef="let element" mat-cell> {{element.number}} </td>
</ng-container>
<ng-container matColumnDef="avgDuration">
<th *matHeaderCellDef mat-header-cell> average rental duration</th>
<td *matCellDef="let element" mat-cell> {{humanizeAvgDuration(element.avgDuration)}} </td>
</ng-container>
<ng-container matColumnDef="marker">
<th *matHeaderCellDef mat-header-cell> icon on map</th>
<td *matCellDef="let element" mat-cell><img [src]="drawIconInTable(element)" alt="marker"></td>
</ng-container>
<tr *matHeaderRowDef="displayedColumnsFrom" mat-header-row></tr>
<tr *matRowDef="let row; columns: displayedColumnsFrom;" mat-row></tr>
</table>
<div *ngIf="isLoadingFromSource"
style="display: flex; justify-content: center; align-items: center; background: white; padding: 10px">
<mat-progress-spinner
color="primary"
mode="indeterminate">
</mat-progress-spinner>
</div>
</div>

View File

@ -4,12 +4,9 @@ img {
a { a {
color: black; color: black;
text-decoration: underline;
} }
.dashboard-table-to { .mat-checkbox-layout label {
margin-right: 1em; margin: 0 !important;
}
.dashboard-table-from {
margin-left: 1em;
} }

View File

@ -1,13 +1,15 @@
<mat-card fxFlex fxLayout="column"> <mat-card style="height: 30rem">
<mat-card-header fxFlex="15%"> <mat-card-header>
<div class="header-image" mat-card-avatar></div> <mat-card-title class="d-flex align-items-center">
<mat-card-title style="margin-top: 1em; margin-left: 0">{{bikePoint?.commonName}}</mat-card-title> <div class="header-image d-inline-flex" mat-card-avatar></div>
{{bikePoint?.commonName}}
</mat-card-title>
</mat-card-header> </mat-card-header>
<mat-card-content fxFlex="70%" fxLayout="column" fxLayoutAlign="space-between"> <mat-card-content class="p-4 d-flex flex-column justify-content-center">
<div class="user-input" fxFlex fxLayout="row" fxLayoutAlign="start center"> <div>
<form [formGroup]="form" style="margin-left: 2em"> <p>Select a range to analyze data</p>
<p>Select a range to analyze data</p> <form [formGroup]="form" class="d-flex flex-row align-items-center justify-content-between">
<mat-form-field appearance="fill" class="datepicker"> <mat-form-field appearance="fill">
<mat-label>Enter a range</mat-label> <mat-label>Enter a range</mat-label>
<mat-date-range-input [max]="maxEndDate" [min]="maxStartDate" [rangePicker]="picker" <mat-date-range-input [max]="maxEndDate" [min]="maxStartDate" [rangePicker]="picker"
formGroupName="dateRange"> formGroupName="dateRange">
@ -17,32 +19,28 @@
<mat-datepicker-toggle [for]="picker" matSuffix></mat-datepicker-toggle> <mat-datepicker-toggle [for]="picker" matSuffix></mat-datepicker-toggle>
<mat-date-range-picker #picker></mat-date-range-picker> <mat-date-range-picker #picker></mat-date-range-picker>
</mat-form-field> </mat-form-field>
</form> <button (click)="onSubmit()" class="mt-n3" color="primary" mat-raised-button>
<div class="submit-date">
<button (click)="onSubmit()" color="primary" mat-raised-button>
<mat-icon>dashboard</mat-icon> <mat-icon>dashboard</mat-icon>
<span id="submit-date-span"> reload</span> reload
</button> </button>
</div> </form>
</div> </div>
<div class="chart-bikepoint-availability" fxFlex fxLayout="column"> <div class="ml-n4" id="chart">
<div id="chart"> <apx-chart
<apx-chart [chart]="chartOptions.chart"
[chart]="chartOptions.chart" [colors]="chartOptions.colors"
[colors]="chartOptions.colors" [dataLabels]="chartOptions.dataLabels"
[dataLabels]="chartOptions.dataLabels" [fill]="chartOptions.fill"
[fill]="chartOptions.fill" [legend]="chartOptions.legend"
[legend]="chartOptions.legend" [plotOptions]="chartOptions.plotOptions"
[plotOptions]="chartOptions.plotOptions" [series]="chartOptions.series"
[series]="chartOptions.series" [stroke]="chartOptions.stroke"
[stroke]="chartOptions.stroke" [subtitle]="chartOptions.subtitle"
[subtitle]="chartOptions.subtitle" [title]="chartOptions.title"
[title]="chartOptions.title" [tooltip]="chartOptions.tooltip"
[tooltip]="chartOptions.tooltip" [xaxis]="chartOptions.xaxis"
[xaxis]="chartOptions.xaxis" [yaxis]="chartOptions.yaxis"
[yaxis]="chartOptions.yaxis" ></apx-chart>
></apx-chart>
</div>
</div> </div>
</mat-card-content> </mat-card-content>
</mat-card> </mat-card>

View File

@ -1,30 +1,4 @@
.header-image { .header-image {
margin-top: 1em;
margin-left: 1em;
margin-bottom: 1em;
background-image: url('../../../assets/bike-point-blue.png'); background-image: url('../../../assets/bike-point-blue.png');
background-size: cover; background-size: cover;
} }
.mat-card {
padding: 1px 1px 1px;
margin: 10px;
}
.mat-card-title {
margin-top: 1em;
margin-left: 2em;
}
.mat-card-subtitle {
margin-left: 39px;
}
#chart {
margin-right: 16px;
}
.submit-date {
margin-top: 1em;
margin-left: 4em;
}

View File

@ -11,6 +11,12 @@ body {
@import "~leaflet/dist/leaflet.css"; @import "~leaflet/dist/leaflet.css";
@import "~leaflet.markercluster/dist/MarkerCluster.css"; @import "~leaflet.markercluster/dist/MarkerCluster.css";
@import "~leaflet.markercluster/dist/MarkerCluster.Default.css"; @import "~leaflet.markercluster/dist/MarkerCluster.Default.css";
@import "~bootstrap/scss/bootstrap";
/* WTF ANGULAR!?!?!?! WHY DO I HAVE TO DO THIS? (see table.component.html@7 and table.component.html@50) */
label.mat-checkbox-layout {
margin: 0 !important;
}
.legend { .legend {
padding: 6px 8px; padding: 6px 8px;