Skip to content

Commit 33bb8e2

Browse files
committed
Initial Commit for mapping section
1 parent 9e19b08 commit 33bb8e2

7 files changed

Lines changed: 110 additions & 5 deletions

File tree

src/app/app-routing.module.ts

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -2,15 +2,16 @@ import { NgModule } from '@angular/core';
22
import { RouterModule, Routes } from '@angular/router';
33
import { CircularHeatmapComponent } from './component/circular-heatmap/circular-heatmap.component';
44
import { MainContentComponent } from './component/main-content/main-content.component';
5+
import { MappingComponent } from './component/mapping/mapping.component';
56
import { MatrixComponent } from './component/matrix/matrix.component';
67
import { TaskDescriptionComponent } from './component/task-description/task-description.component';
78

8-
99
const routes: Routes = [
1010
{path: '',component: MainContentComponent},
1111
{path: 'matrix', component: MatrixComponent},
1212
{path: 'circular-heatmap', component: CircularHeatmapComponent},
13-
{path: 'task-description', component: TaskDescriptionComponent}
13+
{path: 'task-description', component: TaskDescriptionComponent},
14+
{path: 'mapping', component: MappingComponent}
1415
];
1516

1617
@NgModule({

src/app/app.module.ts

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -16,6 +16,7 @@ import { ymlService } from './service/yaml-parser/yaml-parser.service';
1616
import { HttpClientModule } from '@angular/common/http';
1717
import { CombinerService } from './service/combiner/combiner.service';
1818
import { CircularHeatmapComponent } from './component/circular-heatmap/circular-heatmap.component';
19+
import { MappingComponent } from './component/mapping/mapping.component';
1920

2021

2122
@NgModule({
@@ -28,6 +29,8 @@ import { CircularHeatmapComponent } from './component/circular-heatmap/circular-
2829
TopHeaderComponent,
2930
TaskDescriptionComponent,
3031
CircularHeatmapComponent,
32+
MappingComponent,
33+
3134
],
3235
imports: [
3336
BrowserModule,
Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,4 @@
1+
table {
2+
width: 100%;
3+
}
4+
Lines changed: 34 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,34 @@
1+
<table mat-table [dataSource]="dataSource" class="mat-elevation-z8">
2+
3+
<!--- Note that these columns can be defined in any order.
4+
The actual rendered columns are set as a property on the row definition" -->
5+
6+
<!-- Position Column -->
7+
<ng-container matColumnDef="position">
8+
<th mat-header-cell *matHeaderCellDef> No. </th>
9+
<td mat-cell *matCellDef="let element"> {{element.position}} </td>
10+
</ng-container>
11+
12+
<!-- Name Column -->
13+
<ng-container matColumnDef="name">
14+
<th mat-header-cell *matHeaderCellDef> Name </th>
15+
<td mat-cell *matCellDef="let element"> {{element.name}} </td>
16+
</ng-container>
17+
18+
<!-- Weight Column -->
19+
<ng-container matColumnDef="weight">
20+
<th mat-header-cell *matHeaderCellDef> Weight </th>
21+
<td mat-cell *matCellDef="let element"> {{element.weight}} </td>
22+
</ng-container>
23+
24+
<!-- Symbol Column -->
25+
<ng-container matColumnDef="symbol">
26+
<th mat-header-cell *matHeaderCellDef> Symbol </th>
27+
<td mat-cell *matCellDef="let element"> {{element.symbol}} </td>
28+
</ng-container>
29+
30+
<tr mat-header-row *matHeaderRowDef="displayedColumns"></tr>
31+
<tr mat-row *matRowDef="let row; columns: displayedColumns;"></tr>
32+
</table>
33+
34+
Lines changed: 25 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,25 @@
1+
import { ComponentFixture, TestBed } from '@angular/core/testing';
2+
3+
import { MappingComponent } from './mapping.component';
4+
5+
describe('MappingComponent', () => {
6+
let component: MappingComponent;
7+
let fixture: ComponentFixture<MappingComponent>;
8+
9+
beforeEach(async () => {
10+
await TestBed.configureTestingModule({
11+
declarations: [ MappingComponent ]
12+
})
13+
.compileComponents();
14+
});
15+
16+
beforeEach(() => {
17+
fixture = TestBed.createComponent(MappingComponent);
18+
component = fixture.componentInstance;
19+
fixture.detectChanges();
20+
});
21+
22+
it('should create', () => {
23+
expect(component).toBeTruthy();
24+
});
25+
});
Lines changed: 38 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,38 @@
1+
import { Component, OnInit } from '@angular/core';
2+
3+
export interface PeriodicElement {
4+
name: string;
5+
position: number;
6+
weight: number;
7+
symbol: string;
8+
}
9+
10+
const ELEMENT_DATA: PeriodicElement[] = [
11+
{position: 1, name: 'Hydrogen', weight: 1.0079, symbol: 'H'},
12+
{position: 2, name: 'Helium', weight: 4.0026, symbol: 'He'},
13+
{position: 3, name: 'Lithium', weight: 6.941, symbol: 'Li'},
14+
{position: 4, name: 'Beryllium', weight: 9.0122, symbol: 'Be'},
15+
{position: 5, name: 'Boron', weight: 10.811, symbol: 'B'},
16+
{position: 6, name: 'Carbon', weight: 12.0107, symbol: 'C'},
17+
{position: 7, name: 'Nitrogen', weight: 14.0067, symbol: 'N'},
18+
{position: 8, name: 'Oxygen', weight: 15.9994, symbol: 'O'},
19+
{position: 9, name: 'Fluorine', weight: 18.9984, symbol: 'F'},
20+
{position: 10, name: 'Neon', weight: 20.1797, symbol: 'Ne'},
21+
];
22+
23+
@Component({
24+
selector: 'app-mapping',
25+
templateUrl: './mapping.component.html',
26+
styleUrls: ['./mapping.component.css']
27+
})
28+
export class MappingComponent implements OnInit {
29+
30+
displayedColumns: string[] = ['position', 'name', 'weight', 'symbol'];
31+
dataSource = ELEMENT_DATA;
32+
33+
constructor() { }
34+
35+
ngOnInit(): void {
36+
}
37+
38+
}

src/app/component/sidenav-buttons/sidenav-buttons.component.ts

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -6,9 +6,9 @@ import { Component, OnInit } from '@angular/core';
66
styleUrls: ['./sidenav-buttons.component.css']
77
})
88
export class SidenavButtonsComponent implements OnInit {
9-
Options: string[] = ['Matrix', 'Home','Implementation Levels'];
10-
Icons: string[] = ['bar_chart','home','home'];
11-
Routing: string[]=['/matrix','/','/circular-heatmap']
9+
Options: string[] = ['Matrix', 'Home','Implementation Levels','Mappings'];
10+
Icons: string[] = ['bar_chart','home','home','home'];
11+
Routing: string[]=['/matrix','/','/circular-heatmap','/mapping']
1212
constructor() { }
1313

1414
ngOnInit(): void {

0 commit comments

Comments
 (0)