aboutsummaryrefslogtreecommitdiff
path: root/frontend/src/app/_elements/column-table/column-table.component.html
blob: e6d9442c056957abdbc77b0f444f61079dff9ad8 (plain) (blame)
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
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
<table *ngIf="dataset && experiment" class="table text-offwhite">
    <thead>
        <tr>
            <th>Naziv</th>
            <th *ngFor="let colInfo of dataset.columnInfo; let i = index">
                #{{i + 1}}&nbsp;&nbsp;{{colInfo.columnName}}
                <mat-checkbox checked (change)="changeInputColumns($event, colInfo.columnName)"></mat-checkbox>
            </th>
        </tr>
    </thead>
    <tbody>
        <tr>
            <th>Tip</th>
            <td *ngFor="let colInfo of dataset.columnInfo; let i = index">
                <mat-form-field>
                    <mat-select matNativeControl [(value)]="colInfo.isNumber">
                        <mat-option [value]="false">Kategorijski</mat-option>
                        <mat-option [value]="true">Numerički</mat-option>
                    </mat-select>
                </mat-form-field>
            </td>
        </tr>
        <tr>
            <th>Grafik</th>
            <td *ngFor="let colInfo of dataset.columnInfo; let i = index">
                <!--<app-box-plot *ngIf="colInfo.isNumber"></app-box-plot>-->
                <!--TODO: dodati [data]-->
                <!--<app-pie-chart *ngIf="!colInfo.isNumber"></app-pie-chart>-->
            </td>
        </tr>
        <tr>
            <th>Statistika</th>
            <td *ngFor="let colInfo of dataset.columnInfo; let i = index">
                <span *ngIf="colInfo.isNumber">
                    Mean: {{colInfo.mean}}<br>
                    Median: {{colInfo.median}}<br>
                    Min: {{colInfo.min}}<br>
                    Max: {{colInfo.max}}<br>
                    <!-- TODO na ML-u: Q1 i Q3 u statistici 
                    Q1: {{colInfo.q1}}<br>
                    Q3: {{colInfo.q3}}<br>
                    -->
                </span>
                <span *ngIf="!colInfo.isNumber">
                    <span *ngFor="let uniqueValue of colInfo.uniqueValues | slice:0:6; let i = index">
                        {{uniqueValue}}<br><!-- TODO na ML-u: broj ponavljanja unique values-a u zagradi nek pise -->
                    </span>
                </span>
            </td>
        </tr>
        <tr>
            <th (click)="openEncodingDialog()">Enkoding&nbsp;
                <span class="material-icons-round">settings</span>
            </th>
            <td *ngFor="let colInfo of dataset.columnInfo; let i = index">
                <mat-form-field>
                    <mat-select matNativeControl [(value)]="experiment.encodings[i].encoding">
                        <mat-option *ngFor="let option of Object.keys(Encoding); let optionName of Object.values(Encoding)" [value]="option">
                            {{ optionName }}
                        </mat-option>
                    </mat-select>
                </mat-form-field>
            </td>
        </tr>
        <tr>
            <th (click)="openMissingValuesDialog()">Regulisanje nedostajućih vrednosti&nbsp;
                <span class="material-icons-round">settings</span>
            </th>
            <td *ngFor="let colInfo of dataset.columnInfo; let i = index">

                <button mat-button [matMenuTriggerFor]="menu" id="main_{{colInfo.columnName}}">Prikaži opcije</button>
                <mat-menu #menu="matMenu">
                    <button mat-menu-item (click)="MissValsDeleteClicked($event, NullValueOptions.DeleteColumns)" value={{colInfo.columnName}}>Obriši kolonu</button>
                    <button mat-menu-item (click)="MissValsDeleteClicked($event, NullValueOptions.DeleteRows)" value={{colInfo.columnName}}>Obriši redove</button>
                    <button mat-menu-item [matMenuTriggerFor]="fillWith">Popuni sa ____</button>
                </mat-menu>

                <mat-menu #fillWith="matMenu">
                    <button *ngIf="colInfo.isNumber" mat-menu-item (click)="MissValsReplaceClicked($event, colInfo.columnName)" value={{colInfo.mean}}>Mean ({{colInfo.mean}})</button>
                    <button *ngIf="colInfo.isNumber" mat-menu-item (click)="MissValsReplaceClicked($event, colInfo.columnName)" value={{colInfo.median}}>Median ({{colInfo.median}})</button>
                    <button *ngIf="colInfo.isNumber" mat-menu-item (click)="MissValsReplaceClicked($event, colInfo.columnName)" value={{colInfo.max}}>Max ({{colInfo.max}})</button>
                    <button *ngIf="colInfo.isNumber" mat-menu-item (click)="MissValsReplaceClicked($event, colInfo.columnName)" value={{colInfo.min}}>Min ({{colInfo.min}})</button>

                    <button *ngIf="!colInfo.isNumber" mat-menu-item [matMenuTriggerFor]="uniques">Najčešće vrednosti</button>

                    <button mat-menu-item [matMenuTriggerFor]="replaceWith">Unesi vrednost...</button>
                </mat-menu>

                <mat-menu #uniques="matMenu">
                    <button mat-menu-item *ngFor="let uniqueValue of colInfo.uniqueValues" (click)="MissValsReplaceClicked($event, colInfo.columnName)" value={{uniqueValue}}>{{uniqueValue}}</button>
                </mat-menu>

                <mat-menu #replaceWith="matMenu">
                    <input type="text" id={{colInfo.columnName}} mat-menu-item placeholder="Unesi vrednost..." [value]>
                    <button [disabled]="getValue(colInfo.columnName) == ''" mat-menu-item value={{getValue(colInfo.columnName)}} (click)="MissValsReplaceClicked($event, colInfo.columnName)">Potvrdi unos</button>
                </mat-menu>

            </td>
        </tr>
    </tbody>
</table>