Skip to content
GitLab
Menu
Projects
Groups
Snippets
Help
Help
Support
Community forum
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in
Toggle navigation
Menu
Open sidebar
vig
Sublinear Algorithms for VA
pseudo
Commits
ae0aef53
Commit
ae0aef53
authored
Feb 15, 2021
by
Kruyff,D.L.W. (Dylan)
Browse files
Progress window update
Former-commit-id:
18c83683
parent
1ccdf119
Changes
16
Show whitespace changes
Inline
Side-by-side
AngularApp/prototype/src/app/labeling-window/labeling-window.component.css
View file @
ae0aef53
...
@@ -27,7 +27,7 @@
...
@@ -27,7 +27,7 @@
}
}
.label-button
{
.label-button
{
width
:
100
%
;
width
:
33
%
;
height
:
30px
;
height
:
30px
;
}
}
...
...
AngularApp/prototype/src/app/labeling-window/labeling-window.component.html
View file @
ae0aef53
...
@@ -7,6 +7,7 @@
...
@@ -7,6 +7,7 @@
<div
class=
"button-holder"
>
<div
class=
"button-holder"
>
<button
class=
"correct-button label-button"
[class.correct-selected]=
"labels[subplot.index]"
(click)=
"labelCorrect(subplot.index)"
>
✔
</button>
<button
class=
"correct-button label-button"
[class.correct-selected]=
"labels[subplot.index]"
(click)=
"labelCorrect(subplot.index)"
>
✔
</button>
<button
class=
"neutral-button label-button"
[class.neutral-selected]=
"labels[subplot.index] == undefined"
(click)=
"labelUndefined(subplot.index)"
>
•
</button>
<button
class=
"neutral-button label-button"
[class.neutral-selected]=
"labels[subplot.index] == undefined"
(click)=
"labelUndefined(subplot.index)"
>
•
</button>
<button
class=
"incorrect-button label-button"
[class.incorrect-selected]=
"labels[subplot.index] == false"
(click)=
"labelIncorrect(subplot.index)"
>
✖
</button>
</div>
</div>
<plotly-plot
[data]=
"subplot.data"
[layout]=
"subplot.layout"
></plotly-plot>
<plotly-plot
[data]=
"subplot.data"
[layout]=
"subplot.layout"
></plotly-plot>
</div>
</div>
...
...
AngularApp/prototype/src/app/labeling-window/labeling-window.component.ts
View file @
ae0aef53
...
@@ -41,21 +41,22 @@ export class LabelingWindowComponent implements OnInit {
...
@@ -41,21 +41,22 @@ export class LabelingWindowComponent implements OnInit {
if
(
!
this
.
state
.
lshData
)
{
if
(
!
this
.
state
.
lshData
)
{
return
;
return
;
}
}
this
.
topk
=
this
.
state
.
lshData
.
samples
;
this
.
subplots
=
[];
this
.
subplots
=
[];
const
values
:
number
[][][]
=
await
this
.
state
.
getWindow
(
this
.
topk
);
const
values
:
number
[][][]
=
await
this
.
state
.
getWindow
(
this
.
topk
);
for
(
const
idx
in
this
.
topk
)
{
for
(
const
idx
in
this
.
topk
)
{
const
window
=
values
[
idx
];
const
window
=
values
[
idx
];
const
data
=
[];
const
data
=
[];
this
.
state
.
selection
.
forEach
((
channelIndex
,
index
)
=>
{
this
.
state
.
selection
.
forEach
((
channelIndex
,
index
)
=>
{
const
channel
=
window
[
channelIndex
]
const
channel
=
window
[
channelIndex
]
;
data
.
push
({
data
.
push
({
x
:
[...
Array
(
channel
.
length
).
keys
()],
x
:
[...
Array
(
channel
.
length
).
keys
()],
y
:
channel
,
y
:
channel
,
type
:
'
line
'
,
type
:
'
line
'
,
xaxis
:
'
x
'
,
xaxis
:
'
x
'
,
yaxis
:
`y
${
index
+
2
}
`
,
yaxis
:
`y
${
index
+
2
}
`
,
line
:
{
color
:
this
.
state
.
colors
[
channelIndex
],
}
});
});
});
});
const
subplots
=
[];
const
subplots
=
[];
...
@@ -110,7 +111,7 @@ export class LabelingWindowComponent implements OnInit {
...
@@ -110,7 +111,7 @@ export class LabelingWindowComponent implements OnInit {
async
showSamples
()
{
async
showSamples
()
{
this
.
labels
=
[];
this
.
labels
=
[];
this
.
topk
=
this
.
state
.
lshData
.
samples
;
this
.
topk
=
this
.
state
.
lshData
.
samples
.
filter
((
index
)
=>
this
.
state
.
labels
[
index
]
===
undefined
)
;
this
.
subplots
=
[];
this
.
subplots
=
[];
const
values
:
number
[][][]
=
await
this
.
state
.
getWindow
(
this
.
topk
);
const
values
:
number
[][][]
=
await
this
.
state
.
getWindow
(
this
.
topk
);
...
@@ -125,6 +126,9 @@ export class LabelingWindowComponent implements OnInit {
...
@@ -125,6 +126,9 @@ export class LabelingWindowComponent implements OnInit {
type
:
'
line
'
,
type
:
'
line
'
,
xaxis
:
'
x
'
,
xaxis
:
'
x
'
,
yaxis
:
`y
${
index
+
2
}
`
,
yaxis
:
`y
${
index
+
2
}
`
,
line
:
{
color
:
this
.
state
.
colors
[
channelIndex
],
}
});
});
});
});
const
subplots
=
[];
const
subplots
=
[];
...
...
AngularApp/prototype/src/app/labels/labels.component.css
View file @
ae0aef53
.subplot
{
.subplot
{
margin-right
:
20px
;
margin
:
20px
;
width
:
150px
;
height
:
max-content
;
border
:
2px
solid
;
border-radius
:
25px
;
padding
:
20px
;
}
}
.good-labels
{
.good-labels
{
...
@@ -16,3 +19,12 @@
...
@@ -16,3 +19,12 @@
overflow
:
auto
;
overflow
:
auto
;
background-color
:
rgba
(
244
,
67
,
54
,
0.5
);
background-color
:
rgba
(
244
,
67
,
54
,
0.5
);
}
}
.channel_header
{
height
:
20px
;
padding
:
10px
;
color
:
black
;
font-weight
:
500
;
text-align
:
center
;
vertical-align
:
middle
;
}
AngularApp/prototype/src/app/labels/labels.component.html
View file @
ae0aef53
<div
class=
"good-labels"
*ngIf=
"goodLabels.length > 0"
>
<div
class=
"good-labels"
*ngIf=
"goodLabels.length > 0"
>
<div
class=
"subplot"
*ngFor=
"let subplot of goodLabels"
>
<div
class=
"subplot"
*ngFor=
"let subplot of goodLabels"
>
<div
class=
"channel_header"
>
Index: {{ subplot.index }}
</div>
<plotly-plot
[data]=
"subplot.data"
[layout]=
"subplot.layout"
></plotly-plot>
<plotly-plot
[data]=
"subplot.data"
[layout]=
"subplot.layout"
></plotly-plot>
</div>
</div>
</div>
</div>
<div
class=
"bad-labels"
*ngIf=
"badLabels.length > 0"
>
<div
class=
"bad-labels"
*ngIf=
"badLabels.length > 0"
>
<div
class=
"subplot"
*ngFor=
"let subplot of badLabels"
>
<div
class=
"subplot"
*ngFor=
"let subplot of badLabels"
>
<div
class=
"channel_header"
>
Index: {{ subplot.index }}
</div>
<plotly-plot
[data]=
"subplot.data"
[layout]=
"subplot.layout"
></plotly-plot>
<plotly-plot
[data]=
"subplot.data"
[layout]=
"subplot.layout"
></plotly-plot>
</div>
</div>
</div>
</div>
AngularApp/prototype/src/app/labels/labels.component.ts
View file @
ae0aef53
...
@@ -15,49 +15,76 @@ export class LabelsComponent implements OnInit {
...
@@ -15,49 +15,76 @@ export class LabelsComponent implements OnInit {
ngOnInit
():
void
{
ngOnInit
():
void
{
this
.
state
.
onNewLabels
.
subscribe
(()
=>
{
this
.
createSubplots
();
});
this
.
state
.
onNewLabels
.
subscribe
(()
=>
{
this
.
createSubplots
();
});
this
.
state
.
onNewSelection
.
subscribe
(()
=>
{
this
.
createSubplots
();
});
}
}
async
createSubplots
()
{
async
createSubplots
()
{
this
.
goodLabels
=
[];
this
.
goodLabels
=
[];
this
.
badLabels
=
[];
this
.
badLabels
=
[];
const
labelWindows
:
number
[][][]
=
await
this
.
state
.
getWindow
(
Object
.
keys
(
this
.
state
.
labels
).
map
(
Number
));
const
labelWindows
:
number
[][][]
=
await
this
.
state
.
getWindow
(
Object
.
keys
(
this
.
state
.
labels
).
map
(
Number
));
Object
.
keys
(
this
.
state
.
labels
).
forEach
((
key
,
i
)
=>
{
for
(
const
idx
in
Object
.
keys
(
this
.
state
.
labels
).
map
(
Number
))
{
const
index
=
Number
(
key
);
const
window
=
labelWindows
[
idx
];
const
plot
=
const
data
=
[];
{
this
.
state
.
selection
.
forEach
((
channelIndex
,
index
)
=>
{
index
,
const
channel
=
window
[
channelIndex
];
data
:
[{
data
.
push
({
x
:
[...
Array
(
this
.
state
.
windowSize
).
keys
()],
x
:
[...
Array
(
channel
.
length
).
keys
()],
y
:
labelWindows
[
i
],
y
:
channel
,
type
:
'
line
'
type
:
'
line
'
,
}],
xaxis
:
'
x
'
,
yaxis
:
`y
${
index
+
2
}
`
,
});
});
const
subplots
=
[];
this
.
state
.
selection
.
forEach
((
channelIndex
,
index
)
=>
{
subplots
.
push
([
`xy
${
index
+
2
}
`
]);
});
const
plot
=
{
index
:
Object
.
keys
(
this
.
state
.
labels
).
map
(
Number
)[
idx
],
data
:
data
,
layout
:
{
layout
:
{
title
:
`Index:
${
index
.
toString
()}
`
,
grid
:
{
rows
:
this
.
state
.
selection
.
length
,
columns
:
1
,
subplots
:
subplots
,
},
showlegend
:
false
,
hovermode
:
'
closest
'
,
hovermode
:
'
closest
'
,
autosize
:
true
,
autosize
:
true
,
margin
:
{
margin
:
{
l
:
30
,
l
:
30
,
r
:
30
,
r
:
30
,
t
:
30
,
t
:
30
,
b
:
5
,
b
:
0
,
pad
:
4
pad
:
4
},
},
height
:
1
5
0
,
height
:
10
0
*
this
.
state
.
selection
.
length
,
width
:
15
0
,
width
:
30
0
,
titlefont
:
{
titlefont
:
{
size
:
9
size
:
9
},
},
xaxis
:
{
xaxis
:
{
showgrid
:
false
,
zeroline
:
false
,
showticklabels
:
false
,
},
yaxis
:
{
zeroline
:
false
,
showticklabels
:
false
,
showticklabels
:
false
,
}
}
}
}
};
};
if
(
this
.
state
.
labels
[
key
])
{
this
.
state
.
selection
.
forEach
((
channelIndex
,
index
)
=>
{
plot
.
layout
[
`yaxis
${
index
+
2
}
`
]
=
{
zeroline
:
false
,
showticklabels
:
false
,
};
});
if
(
this
.
state
.
labels
[
Object
.
keys
(
this
.
state
.
labels
).
map
(
Number
)[
idx
]])
{
this
.
goodLabels
.
push
(
plot
);
this
.
goodLabels
.
push
(
plot
);
}
else
{
}
else
{
this
.
badLabels
.
push
(
plot
);
this
.
badLabels
.
push
(
plot
);
}
}
});
}
}
}
}
}
AngularApp/prototype/src/app/main/main.component.html
View file @
ae0aef53
...
@@ -21,7 +21,7 @@
...
@@ -21,7 +21,7 @@
<as-split-area
[size]=
"70"
>
<as-split-area
[size]=
"70"
>
<as-split
direction=
"horizontal"
>
<as-split
direction=
"horizontal"
>
<as-split-area
[size]=
"
7
0"
>
<as-split-area
[size]=
"
6
0"
>
<div
class=
"channel_header"
>
<div
class=
"channel_header"
>
Feedback
Feedback
</div>
</div>
...
@@ -29,7 +29,7 @@
...
@@ -29,7 +29,7 @@
<app-training-window></app-training-window>
<app-training-window></app-training-window>
</div>
</div>
</as-split-area>
</as-split-area>
<as-split-area
[size]=
"
3
0"
>
<as-split-area
[size]=
"
4
0"
>
<div
class=
"channel_header"
>
<div
class=
"channel_header"
>
Results
Results
</div>
</div>
...
...
AngularApp/prototype/src/app/overview-window/overview-window.component.css
View file @
ae0aef53
...
@@ -25,7 +25,7 @@
...
@@ -25,7 +25,7 @@
overflow
:
scroll
;
overflow
:
scroll
;
}
}
.container
{
.
main-
container
{
height
:
100%
;
height
:
100%
;
display
:
flex
;
display
:
flex
;
justify-content
:
space-between
;
justify-content
:
space-between
;
...
@@ -116,3 +116,69 @@ path {
...
@@ -116,3 +116,69 @@ path {
text-align
:
center
;
text-align
:
center
;
vertical-align
:
middle
;
vertical-align
:
middle
;
}
}
.container
{
display
:
block
;
position
:
relative
;
padding-left
:
35px
;
margin-bottom
:
12px
;
cursor
:
pointer
;
-webkit-user-select
:
none
;
-moz-user-select
:
none
;
-ms-user-select
:
none
;
user-select
:
none
;
}
/* Hide the browser's default checkbox */
.container
input
{
position
:
absolute
;
opacity
:
0
;
cursor
:
pointer
;
height
:
0
;
width
:
0
;
}
/* Create a custom checkbox */
.checkmark
{
position
:
absolute
;
top
:
0
;
left
:
0
;
height
:
25px
;
width
:
25px
;
background-color
:
#eee
;
}
/* On mouse-over, add a grey background color */
.container
:hover
input
~
.checkmark
{
background-color
:
#ccc
;
}
/* When the checkbox is checked, add a blue background */
.container
input
:checked
~
.checkmark
{
background-color
:
#2196F3
;
}
/* Create the checkmark/indicator (hidden when not checked) */
.checkmark
:after
{
content
:
""
;
position
:
absolute
;
display
:
none
;
}
/* Show the checkmark when checked */
.container
input
:checked
~
.checkmark
:after
{
display
:
block
;
}
/* Style the checkmark/indicator */
.container
.checkmark
:after
{
left
:
9px
;
top
:
5px
;
width
:
5px
;
height
:
10px
;
border
:
solid
white
;
border-width
:
0
3px
3px
0
;
-webkit-transform
:
rotate
(
45deg
);
-ms-transform
:
rotate
(
45deg
);
transform
:
rotate
(
45deg
);
}
AngularApp/prototype/src/app/overview-window/overview-window.component.html
View file @
ae0aef53
<div
class=
"container"
>
<div
class=
"main-container"
>
<div
class=
"left"
>
<as-split
direction=
"horizontal"
>
<as-split-area
[size]=
"10"
>
<div
class=
"channel_header"
>
<div
class=
"channel_header"
>
Channels
Channels
</div>
</div>
<div
class=
"list"
>
<div
class=
"list"
>
<div
class=
"list-element"
*ngFor=
"let index of allChannels"
>
<div
class=
"list-element"
*ngFor=
"let index of allChannels"
>
<mat-checkbox
[checked]=
"isInSelection(
index
)"
<label
class=
"container"
>
{{ names[
index
] }}
(change
)=
"changeSelection(index)"
>
<input
type=
"checkbox"
[checked]=
"isInSelection(index)"
(click
)=
"changeSelection(index)"
>
{{ names[index] }}
<span
class=
"checkmark"
[ngStyle]=
"isInSelection(index) && {'background-color': getColor(index)} || {}"
></span>
</mat-checkbox
>
</label
>
</div>
</div>
</div>
</div>
</
div
>
</
as-split-area
>
<div
class=
"right
"
>
<as-split-area
[size]=
"90
"
>
<div
class=
"channel_header"
>
<div
class=
"channel_header"
>
O
verview
Dataset o
verview
</div>
</div>
<div
class=
"toolbar"
>
<div
class=
"toolbar"
>
...
@@ -31,5 +32,6 @@
...
@@ -31,5 +32,6 @@
<div
class=
"overview"
>
<div
class=
"overview"
>
<zingchart-angular
#chart
[id]=
"id"
(mousewheel)=
"zoom($event)"
(zoom)=
"ping()"
[height]=
"height"
(complete)=
"ping()"
></zingchart-angular>
<zingchart-angular
#chart
[id]=
"id"
(mousewheel)=
"zoom($event)"
(zoom)=
"ping()"
[height]=
"height"
(complete)=
"ping()"
></zingchart-angular>
</div>
</div>
</div>
</as-split-area>
</as-split>
</div>
</div>
AngularApp/prototype/src/app/overview-window/overview-window.component.ts
View file @
ae0aef53
...
@@ -36,6 +36,7 @@ export class OverviewWindowComponent implements OnInit {
...
@@ -36,6 +36,7 @@ export class OverviewWindowComponent implements OnInit {
this
.
state
.
onNewData
.
subscribe
(()
=>
this
.
initializePlot
());
this
.
state
.
onNewData
.
subscribe
(()
=>
this
.
initializePlot
());
this
.
state
.
onNewLshData
.
subscribe
(()
=>
this
.
updatePlot
());
this
.
state
.
onNewLshData
.
subscribe
(()
=>
this
.
updatePlot
());
this
.
state
.
onNewSelection
.
subscribe
(()
=>
this
.
updateChannels
());
this
.
state
.
onNewSelection
.
subscribe
(()
=>
this
.
updateChannels
());
this
.
state
.
onNewSlider
.
subscribe
(()
=>
this
.
updateCandidates
());
}
}
dostuff3
()
{
dostuff3
()
{
...
@@ -201,6 +202,7 @@ export class OverviewWindowComponent implements OnInit {
...
@@ -201,6 +202,7 @@ export class OverviewWindowComponent implements OnInit {
values
:
data
,
values
:
data
,
text
:
'
Raw Values
'
,
text
:
'
Raw Values
'
,
zIndex
:
5
,
zIndex
:
5
,
'
line-color
'
:
this
.
state
.
colors
[
channelIndex
],
marker
:
{
marker
:
{
alpha
:
0.0
,
alpha
:
0.0
,
zIndex
:
10
zIndex
:
10
...
@@ -243,8 +245,8 @@ export class OverviewWindowComponent implements OnInit {
...
@@ -243,8 +245,8 @@ export class OverviewWindowComponent implements OnInit {
data
:
this
.
config
data
:
this
.
config
});
});
console
.
log
(
"
showing plot
"
);
console
.
log
(
"
showing plot
"
);
this
.
minx
=
0
;
this
.
_
minx
=
0
;
this
.
maxx
=
1
2
0
;
this
.
_
maxx
=
this
.
state
.
rawData
[
0
].
values
.
length
/
10
;
// await this.debugClicked();
// await this.debugClicked();
}
}
...
@@ -255,6 +257,7 @@ export class OverviewWindowComponent implements OnInit {
...
@@ -255,6 +257,7 @@ export class OverviewWindowComponent implements OnInit {
async
updateChannels
()
{
async
updateChannels
()
{
console
.
log
(
'
updating plot
'
);
console
.
log
(
'
updating plot
'
);
console
.
log
(
this
.
state
.
selection
);
this
.
graphset
=
this
.
graphset
.
slice
(
0
,
1
);
this
.
graphset
=
this
.
graphset
.
slice
(
0
,
1
);
this
.
state
.
selection
.
forEach
((
channelIndex
,
index
)
=>
{
this
.
state
.
selection
.
forEach
((
channelIndex
,
index
)
=>
{
const
channel
=
this
.
state
.
rawData
[
channelIndex
];
const
channel
=
this
.
state
.
rawData
[
channelIndex
];
...
@@ -286,6 +289,7 @@ export class OverviewWindowComponent implements OnInit {
...
@@ -286,6 +289,7 @@ export class OverviewWindowComponent implements OnInit {
values
:
data
,
values
:
data
,
text
:
'
Raw Values
'
,
text
:
'
Raw Values
'
,
zIndex
:
5
,
zIndex
:
5
,
'
line-color
'
:
this
.
state
.
colors
[
channelIndex
],
marker
:
{
marker
:
{
alpha
:
0.0
,
alpha
:
0.0
,
zIndex
:
10
zIndex
:
10
...
@@ -316,7 +320,7 @@ export class OverviewWindowComponent implements OnInit {
...
@@ -316,7 +320,7 @@ export class OverviewWindowComponent implements OnInit {
this
.
markers
=
[];
this
.
markers
=
[];
for
(
const
index
in
this
.
state
.
labels
)
{
for
(
const
index
in
this
.
state
.
labels
)
{
if
(
this
.
state
.
labels
[
index
])
{
if
(
this
.
state
.
labels
[
index
])
{
this
.
goodLabels
.
push
([
Number
(
index
),
0
]);
this
.
goodLabels
.
push
([
Number
(
index
),
1
]);
this
.
markers
.
push
({
this
.
markers
.
push
({
type
:
'
area
'
,
type
:
'
area
'
,
// BUG: For some reason the range values are multiplied by 10
// BUG: For some reason the range values are multiplied by 10
...
@@ -362,37 +366,37 @@ export class OverviewWindowComponent implements OnInit {
...
@@ -362,37 +366,37 @@ export class OverviewWindowComponent implements OnInit {
console
.
log
(
"
zoom
"
);
console
.
log
(
"
zoom
"
);
}
}
async
updateCandidates
(
sliderIndex
)
{
async
updateCandidates
()
{
//
let candidates = [];
let
candidates
=
[];
//
for (let i =
sliderIndex
; i < this.s
ervice.nrOfTables
; i++) {
for
(
let
i
=
0
;
i
<
=
this
.
s
tate
.
sliderValue
;
i
++
)
{
//
candidates = candidates.concat(this.s
ervice.windowSimilarity[sliderIndex.toString()
]);
candidates
=
candidates
.
concat
(
this
.
s
tate
.
lshData
.
average_table
[
Object
.
keys
(
this
.
state
.
lshData
.
average_table
)[
i
]
]);
//
}
}
//
cons
t labels = []
;
cons
ole
.
log
(
'
updating candidates
'
)
;
//
cons
t markers = []
;
cons
ole
.
log
(
candidates
)
;
// for (const index of candidates) {
// labels.push([Number(index) * (12000 / 6), 0])
;
this
.
candidateLabels
=
[]
;
//
markers
.push({
this
.
markers
=
[];
// type: 'area',
// // BUG: For some reason the range values are multiplied by 10
for
(
const
index
of
candidates
)
{
// range: [Number(index) * (12000 / 6) / 10, (Number(index) * (12000 / 6) + this.state.windowSize) / 10],
this
.
candidateLabels
.
push
([
Number
(
index
),
0
]);
// backgroundColor: '#b1a343',
this
.
markers
.
push
({
//
});
type
:
'
area
'
,
//
}
//
BUG: For some reason the range values are multiplied by 10
// const newSeries = this.config.series.slice(0, 3);
range
:
[
Number
(
index
)
/
10
,
(
Number
(
index
)
+
this
.
state
.
windowSize
)
/
10
],
// newSeries.push({
backgroundColor
:
'
#b1a343
'
,
// type: 'scatter',
});
// values: labels,
}
// text: 'Similar windows',
// marker:
{
for
(
const
channel
of
this
.
config
.
graphset
)
{
// backgroundColor: '#b1a343'
if
(
channel
.
type
===
'
line
'
)
{
//
},
channel
.
scaleX
.
markers
=
this
.
markers
;
// zIndex: 20,
}
else
{
// })
;
channel
.
series
[
2
].
values
=
this
.
candidateLabels
;
// this.config.series = newSeries;
}
// this.config.scaleX.markers = this.markers.concat(markers);