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

93.75% Statements 75/80
87.5% Branches 14/16
72.72% Functions 8/11
97.72% Lines 43/44

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 72 73 74 75 76 77 78 79 80 81 82 83 84 85    7x   5855x                 2924x           7x 1896x   7x 2924x   5848x   6x   2390x 18x   6x 1177x     7x   5848x     6x   2396x       1195x   6x   12x 6x 2390x 1195x 6x 6x 6x 6x 6x 6x   6x 1195x   6x   6x     5848x   691x 679x 12x 73x 7959x 73x   12x     5848x 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: '250px',
                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"
                [virtualScroll]="true"
                [virtualScrollItemSize]="40"
                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>