Updated graphs layout

This commit is contained in:
Nile Walker 2021-01-29 16:37:06 -05:00
parent 052ec2033a
commit a022259aed
2 changed files with 112 additions and 107 deletions

View File

@ -36,15 +36,13 @@ mat-form-field {
mat-card {
margin: 20px;
}
button {
margin: 20px;
}
body {
padding: 20px;
}
.flex-grid {
margin: 0 0 20px 0;
margin: 0 20px 20px 0;
}
.col {
/* background: salmon; */

View File

@ -39,131 +39,138 @@
</mat-card>
</div>
<mat-card class="row">
<mat-card class="row">
<mat-card-header class="flex-grid">
<h3 class="col">Search</h3>
<button mat-flat-button class="btn-lg col" color="primary" (click)="searchToday()">Today</button>
<button mat-flat-button class="btn-lg col" color="primary" (click)="searchAll()">All</button>
<button mat-flat-button class="btn-lg col" color="primary" (click)="updateGraphData()">Run</button>
</mat-card-header>
<mat-form-field>
<mat-date-range-input [rangePicker]="picker">
<input matStartDate [(ngModel)]="start_date">
<input matEndDate [(ngModel)]="end_date">
</mat-date-range-input>
<mat-datepicker-toggle matSuffix [for]="picker"></mat-datepicker-toggle>
<mat-date-range-picker #picker></mat-date-range-picker>
</mat-form-field>
<mat-form-field>
<mat-label>Location ID(s)</mat-label>
<textarea matInput [(ngModel)]="form.location" placeholder="Location Codes"></textarea>
</mat-form-field>
<mat-form-field>
<mat-label>Student ID(s)</mat-label>
<textarea matInput [(ngModel)]="form.student_id" placeholder="Ex. It makes me feel..."></textarea>
</mat-form-field>
<mat-form-field>
<mat-label>Compute ID(s)</mat-label>
<textarea matInput [(ngModel)]="form.compute_id" placeholder="Ex. It makes me feel..."></textarea>
</mat-form-field>
</mat-card>
<mat-card class="col">
<mat-card-header>
<h1>{{ChartName}}</h1>
</mat-card-header>
<canvas baseChart [datasets]="dailyChartsData" [labels]="dailyChartLabels" [options]="barChartOptions"
[legend]="true" chartType="bar" (chartClick)="chartClicked($event)">
</canvas>
</mat-card>
<mat-card-header>
<div class="flex-grid">
<h1 class="col">Search</h1>
<div class="col">
<button mat-raised-button class="btn-lg" color="primary" (click)="searchToday()">Today</button>
</div>
<div class="col">
<button mat-raised-button class="btn-lg" color="primary" (click)="searchAll()">All</button>
</div>
<div class="col">
<button mat-raised-button class="btn-lg" color="primary" (click)="updateGraphData()">Run</button>
</div>
</div>
</mat-card-header>
<div class="flex-grid">
<mat-form-field class="col">
<mat-date-range-input [rangePicker]="picker">
<input matStartDate [(ngModel)]="start_date">
<input matEndDate [(ngModel)]="end_date">
</mat-date-range-input>
<mat-datepicker-toggle matSuffix [for]="picker"></mat-datepicker-toggle>
<mat-date-range-picker #picker></mat-date-range-picker>
</mat-form-field>
<mat-card class="col">
<mat-card-header>
<h1>Average Count By Weekday For {{form.start_date | date}} - {{form.end_date | date}}</h1>
</mat-card-header>
<mat-form-field class="col">
<mat-label>Location ID(s)</mat-label>
<textarea matInput [(ngModel)]="form.location" placeholder="Location Codes"></textarea>
</mat-form-field>
<div style="display: block">
<canvas baseChart [datasets]="weekdayChartsData" [labels]="weekdayChartLabels" [options]="barChartOptions"
[legend]=false chartType="horizontalBar">
</canvas>
</div>
</mat-card>
<mat-form-field class="col">
<mat-label>Student ID(s)</mat-label>
<textarea matInput [(ngModel)]="form.student_id" placeholder="Ex. It makes me feel..."></textarea>
</mat-form-field>
<mat-card class="col">
<mat-card-header>
<h1>Average Count By Hour For {{form.start_date | date}} - {{form.end_date | date}}</h1>
</mat-card-header>
<mat-form-field class="col">
<mat-label>Compute ID(s)</mat-label>
<textarea matInput [(ngModel)]="form.compute_id" placeholder="Ex. It makes me feel..."></textarea>
</mat-form-field>
</div>
<div style="display: block">
<canvas baseChart [datasets]="hourlyChartsData" [labels]="hourlyChartLabels" [options]="barChartOptions"
[legend]=false chartType="horizontalBar">
</canvas>
</div>
</mat-card>
<div class="flex-grid row">
<mat-card class="col">
<mat-card-header>
<h1>{{ChartName}}</h1>
</mat-card-header>
</mat-card>
<canvas baseChart [datasets]="dailyChartsData" [labels]="dailyChartLabels" [options]="barChartOptions"
[legend]="true" chartType="bar" (chartClick)="chartClicked($event)">
</canvas>
</mat-card>
<mat-card class="col">
<mat-card-header>
<h1>Average Count By Weekday For {{form.start_date | date}} - {{form.end_date | date}}</h1>
</mat-card-header>
<div style="display: block">
<canvas baseChart [datasets]="weekdayChartsData" [labels]="weekdayChartLabels" [options]="barChartOptions"
[legend]=false chartType="horizontalBar">
</canvas>
</div>
</mat-card>
<mat-card class="col">
<mat-card-header>
<h1>Average Count By Hour For {{form.start_date | date}} - {{form.end_date | date}}</h1>
</mat-card-header>
<div style="display: block">
<canvas baseChart [datasets]="hourlyChartsData" [labels]="hourlyChartLabels" [options]="barChartOptions"
[legend]=false chartType="horizontalBar">
</canvas>
</div>
<mat-card>
<mat-card-header>
<h3 class="mb-0">Records to be processed </h3>
</mat-card-header>
</mat-card>
<table mat-table [dataSource]="searchResult" class="mat-elevation-z8">
</div>
<!--- Note that these columns can bea defined in any order.
<mat-card>
<mat-card-header>
<h3 class="mb-0">Records to be processed </h3>
</mat-card-header>
<table mat-table [dataSource]="searchResult" class="mat-elevation-z8">
<!--- Note that these columns can bea defined in any order.
The actual rendered columns are set as a property on the row definition" -->
<!-- Position Column -->
<ng-container matColumnDef="position">
<th mat-header-cell *matHeaderCellDef> Barcode </th>
<!-- Position Column -->
<ng-container matColumnDef="position">
<th mat-header-cell *matHeaderCellDef> Barcode </th>
<td mat-cell *matCellDef="let sample; let i = index;"> {{sample.barcode}} </td>
</ng-container>
<td mat-cell *matCellDef="let sample; let i = index;"> {{sample.barcode}} </td>
</ng-container>
<!-- Name Column -->
<ng-container matColumnDef="name">
<th mat-header-cell *matHeaderCellDef> Date </th>
<!-- Name Column -->
<ng-container matColumnDef="name">
<th mat-header-cell *matHeaderCellDef> Date </th>
<td mat-cell *matCellDef="let sample; let i = index;"> {{sample.date}}</td>
</ng-container>
<td mat-cell *matCellDef="let sample; let i = index;"> {{sample.date}}</td>
</ng-container>
<!-- Weight Column -->
<ng-container matColumnDef="weight">
<th mat-header-cell *matHeaderCellDef> Location </th>
<!-- Weight Column -->
<ng-container matColumnDef="weight">
<th mat-header-cell *matHeaderCellDef> Location </th>
<td mat-cell *matCellDef="let sample; let i = index;"> Location: {{sample.location}}<br>Station:
{{sample.station}}</td>
</ng-container>
<td mat-cell *matCellDef="let sample; let i = index;"> Location: {{sample.location}}<br>Station:
{{sample.station}}</td>
</ng-container>
<ng-container matColumnDef="email">
<ng-container matColumnDef="email">
<th mat-header-cell *matHeaderCellDef> IDs </th>
<td mat-cell *matCellDef="let sample; let i = index;">
Compute ID: {{sample.compute_id}}<br>Student ID: {{sample.student_id}}
</td>
</ng-container>
<ng-container matColumnDef="text">
<th mat-header-cell *matHeaderCellDef> Contacts </th>
<td mat-cell *matCellDef="let sample; let i = index;">
Phone: {{sample.phone}}<br>Email: {{sample.email}}
</td>
</ng-container>
<tr mat-header-row *matHeaderRowDef="displayedColumns"></tr>
<tr mat-row *matRowDef="let row; columns: displayedColumns;"></tr>
</table>
<th mat-header-cell *matHeaderCellDef> IDs </th>
<td mat-cell *matCellDef="let sample; let i = index;">
Compute ID: {{sample.compute_id}}<br>Student ID: {{sample.student_id}}
</td>
</ng-container>
<ng-container matColumnDef="text">
<th mat-header-cell *matHeaderCellDef> Contacts </th>
<td mat-cell *matCellDef="let sample; let i = index;">
Phone: {{sample.phone}}<br>Email: {{sample.email}}
</td>
</ng-container>
<tr mat-header-row *matHeaderRowDef="displayedColumns"></tr>
<tr mat-row *matRowDef="let row; columns: displayedColumns;"></tr>
</table>
</mat-card>
</mat-card>
</div>