-
Notifications
You must be signed in to change notification settings - Fork 7
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
1 parent
39087f9
commit 849e672
Showing
10 changed files
with
185 additions
and
25 deletions.
There are no files selected for viewing
Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.
Oops, something went wrong.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
11 changes: 11 additions & 0 deletions
11
buildingmotif-app/src/app/parser-vis/parser-vis.component.css
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,11 @@ | ||
.my-parser-vis { | ||
display: flex; | ||
flex-direction: row; | ||
} | ||
|
||
.parser-vis { | ||
display: flex; | ||
flex-direction: column; | ||
margin : .5rem; | ||
justify-content: center; | ||
} |
67 changes: 67 additions & 0 deletions
67
buildingmotif-app/src/app/parser-vis/parser-vis.component.html
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,67 @@ | ||
<ul *ngIf="parser.args" class="my-parser-vis"> | ||
<ng-container *ngFor="let child of parser.args.parsers" [ngTemplateOutlet]="treeNode" | ||
[ngTemplateOutletContext]="{ $implicit: child }"> | ||
</ng-container> | ||
</ul> | ||
|
||
<ng-template #substring_n let-data> | ||
<div class="parser-vis"> | ||
<div>{{data.args.type_name}}</div> | ||
<mat-icon style="color: #a55b80;" matSuffix>square</mat-icon> | ||
</div> | ||
</ng-template> | ||
|
||
<ng-template #stringUrl let-data> | ||
<div class="parser-vis"> | ||
<div>{{data.args.type_name}}</div> | ||
<mat-icon style="color: #5ba5a5;" matSuffix>square</mat-icon> | ||
</div> | ||
</ng-template> | ||
|
||
<ng-template #rest let-data> | ||
<div class="parser-vis"> | ||
<div>{{data.args.type_name}}</div> | ||
<mat-icon style="color: #a55b5b;" matSuffix>square</mat-icon> | ||
</div> | ||
</ng-template> | ||
|
||
<ng-template #stringToken let-data> | ||
<div class="parser-vis"> | ||
<div>{{data.args.s}}</div> | ||
<mat-icon style="color: #a5a55b;" matSuffix>square</mat-icon> | ||
</div> | ||
</ng-template> | ||
|
||
<ng-template #treeNode let-data> | ||
<ng-container *ngIf="data.uiParser == 'choice'"> | ||
<div class="parser-vis"> | ||
<ng-container *ngFor="let child of data.args.parsers" [ngTemplateOutlet]="treeNode" | ||
[ngTemplateOutletContext]="{ $implicit: child }"> | ||
</ng-container> | ||
</div> | ||
</ng-container> | ||
|
||
<ng-container *ngIf="data.uiParser == 'sequence-internal'"> | ||
<div style="display: flex; flex-direction: row; justify-content: start;"> | ||
<ng-container *ngFor="let child of data.args.parsers" [ngTemplateOutlet]="treeNode" | ||
[ngTemplateOutletContext]="{ $implicit: child }"> | ||
</ng-container> | ||
</div> | ||
</ng-container> | ||
|
||
<ng-container *ngIf="data.uiParser == 'substring_n'" [ngTemplateOutlet]="substring_n" | ||
[ngTemplateOutletContext]="{ $implicit: data }"> | ||
</ng-container> | ||
|
||
<ng-container *ngIf="data.uiParser == 'rest'" [ngTemplateOutlet]="rest" | ||
[ngTemplateOutletContext]="{ $implicit: data }"> | ||
</ng-container> | ||
|
||
<ng-container *ngIf="data.uiParser == 'string-url'" [ngTemplateOutlet]="stringUrl" | ||
[ngTemplateOutletContext]="{ $implicit: data }"> | ||
</ng-container> | ||
|
||
<ng-container *ngIf="data.uiParser == 'string-token'" [ngTemplateOutlet]="stringToken" | ||
[ngTemplateOutletContext]="{ $implicit: data }"> | ||
</ng-container> | ||
</ng-template> |
23 changes: 23 additions & 0 deletions
23
buildingmotif-app/src/app/parser-vis/parser-vis.component.spec.ts
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,23 @@ | ||
import { ComponentFixture, TestBed } from '@angular/core/testing'; | ||
|
||
import { ParserVisComponent } from './parser-vis.component'; | ||
|
||
describe('ParserVisComponent', () => { | ||
let component: ParserVisComponent; | ||
let fixture: ComponentFixture<ParserVisComponent>; | ||
|
||
beforeEach(async () => { | ||
await TestBed.configureTestingModule({ | ||
declarations: [ ParserVisComponent ] | ||
}) | ||
.compileComponents(); | ||
|
||
fixture = TestBed.createComponent(ParserVisComponent); | ||
component = fixture.componentInstance; | ||
fixture.detectChanges(); | ||
}); | ||
|
||
it('should create', () => { | ||
expect(component).toBeTruthy(); | ||
}); | ||
}); |
16 changes: 16 additions & 0 deletions
16
buildingmotif-app/src/app/parser-vis/parser-vis.component.ts
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,16 @@ | ||
import { Component, OnInit, Input} from '@angular/core'; | ||
|
||
@Component({ | ||
selector: 'app-parser-vis', | ||
templateUrl: './parser-vis.component.html', | ||
styleUrls: ['./parser-vis.component.css'] | ||
}) | ||
export class ParserVisComponent implements OnInit { | ||
@Input() parser: any | undefined; | ||
|
||
constructor() { } | ||
|
||
ngOnInit(): void { | ||
} | ||
|
||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -22,4 +22,5 @@ svg { | |
ngx-codemirror { | ||
height: 100%; | ||
width: 100%; | ||
font-size: 24px; | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters