Select Git revision
-
Michael Hartung authoredMichael Hartung authored
Code owners
Assign users and groups as approvers for specific file changes. Learn more.
network-legend.component.html 2.00 KiB
<div class="legend" [class.right]="this.config.legendPos === 'right'">
<!-- default legend in html -->
<table *ngIf="!this.config.legendUrl.length">
<ng-container *ngIf="this.config.showLegendNodes">
<tr *ngFor="let nodeGroup of this.config.nodeGroups | keyvalue" class="list-item">
<ng-container *ngIf="nodeGroup.value.image">
<!-- group icon given, use icon in legend -->
<td>
<img [src]="nodeGroup.value.image" class="legend-icon"/>
</td>
<td> {{ nodeGroup.value.name }}</td>
</ng-container>
<ng-container *ngIf="!nodeGroup.value.image">
<!-- no image given, create icon programmatically -->
<td *ngIf="nodeGroup.value.shape !== 'triangle' && nodeGroup.value.shape !== 'star'">
<span class="node {{ nodeGroup.value.shape }}" [style.background-color]=nodeGroup.value.color>
</span>
</td>
<td *ngIf="nodeGroup.value.shape === 'triangle'">
<span class="node {{ nodeGroup.value.shape }}" [style.border-bottom-color]=nodeGroup.value.color>
</span>
</td>
<td *ngIf="nodeGroup.value.shape === 'star'">
<span class="node {{ nodeGroup.value.shape }}"
[style.border-bottom-color]=nodeGroup.value.color
[style.color]=nodeGroup.value.color
>
</span>
</td>
<td> {{ nodeGroup.value.name }}</td>
</ng-container>
</tr>
</ng-container>
<ng-container *ngIf="this.config.showLegendEdges">
<tr *ngFor="let edgeGroup of this.config.edgeGroups | keyvalue" class="list-item">
<td>
<hr class="edge" [style.background-color]=edgeGroup.value.color>
</td>
<td> {{ edgeGroup.value.name }}</td>
</tr>
</ng-container>
</table>
<!-- custom legend image if url given by user -->
<img *ngIf="this.config.legendUrl.length" [src]="this.config.legendUrl" [ngClass]="this.config.legendClass"/>
</div>