All files / src/app/components/phases-graph phases-graph.component.html

91.25% Statements 73/80
81.25% Branches 13/16
72.72% Functions 8/11
95.12% Lines 39/41

Press n or j to go to the next uncovered block, b, p or k for the previous block.

1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 64 65 66 67 68 69 70 71    4791x       2392x         7x 1944x   7x 2392x   4784x   4x   1106x     2x 553x     7x   4784x     1108x   2x   4x 2x 1106x 553x 2x 2x 4x 2x 2x 2x   2x 553x   2x   2x     4784x   403x 397x 6x 34x 4126x 34x   6x     4784x 7x  
<div class="phases-graph">
    <div class="graph-setup">
        <p-multiselect class="phases-selector" [(ngModel)]="selectedPhases" [options]="displayCampaigns"
            [group]="true" optionLabel="name" optionGroupChildren="phases"
            [filter]="true" filterMatchMode="contains"
            [lazy]="false" [virtualScroll]="true"
            [virtualScrollOptions]="{
                scrollHeight: '200px',
                itemSize: 40,
            }"
            placeholder="Select phases to compare">
            <ng-template #group let-group>
                <span class="select-group">{{ group.campaignName }}</span>
            </ng-template>
        </p-multiselect>
        <app-multi-select-signals #signalsMultiSelect [isLive]="false" [postProcessingMode]="true">
        </app-multi-select-signals>
        @if (selectedPhases.length > 0 && selectedSignalIds.length > 0)
        {
            <p-button id="loadData" (click)="loadGraphData()">Load</p-button>
 
            @if (isDownloading) {
                <p-splitbutton icon="pi pi-spinner pi-spin" [model]="exports" severity="secondary" />
            }
            @else {
                <p-splitbutton icon="pi pi-download" [model]="exports" severity="secondary" />
            }
        }
    </div>
 
    @if (selectedPhases.length > 0 && selectedSignalIds.length > 0)
    {
        <div class="phase-modifying">
            <p-select class="phase-selector" [(ngModel)]="phaseToModify" [options]="selectedPhases" optionLabel="name"
                placeholder="Phase to modify">
            </p-select>
            <div>
                <p-button id="offset-phase-left" icon="pi pi-chevron-left" severity="secondary" title="Shift to the left"
                    (onClick)="movePhaseLeft()" />
                <p-inputnumber class="offset-input" [inputStyle]="{ width: '5rem' }" [(ngModel)]="phaseOffset"
                    [maxFractionDigits]="3" suffix=" s" placeholder="Offset">
                </p-inputnumber>
                <p-button id="offset-phase-right" icon="pi pi-chevron-right" severity="secondary" title="Shift to the right"
                    (onClick)="movePhaseRight()" />
            </div>
            <p-button id="reset-phase" icon="pi pi-undo" label="Reset" severity="secondary" (onClick)="resetPhaseMove()" />
        </div>
 
        <app-signals-graph #phasesGraph
            [signalIdsToPlot]="[]" [isLive]="false" [relativeMode]="true"
            (replayWindowMiddleChange)="onWindowMiddleChange($event)"
            (replayWindowLengthChange)="onWindowLengthChange($event)">
 
        </app-signals-graph>
    }
 
    @if (dataLoaded)
    {
        <p-listbox [(ngModel)]="selectedDataSets" [options]="dataSets" optionLabel="name"
            [multiple]="true" [metaKeySelection]="true">
            <ng-template #item let-dataset>
                <div class="data-set-item" (contextmenu)="onContextMenu($event, dataset)">
                    {{ dataset.name }}
                </div>
            </ng-template>
        </p-listbox>
    }
 
    <p-contextmenu #contextMenu [model]="items" />
</div>