Skip to content
GitLab
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
660d72ed
Commit
660d72ed
authored
Sep 14, 2020
by
Kruyff,D.L.W. (Dylan)
Browse files
Bug fix: display correct query position in tables
parent
f7d56127
Changes
6
Hide whitespace changes
Inline
Side-by-side
AngularApp/prototype/src/app/cache.service.ts
View file @
660d72ed
...
...
@@ -73,7 +73,6 @@ export class CacheService {
async
getSimilarWindows
():
Promise
<
any
>
{
this
.
windowSimilarity
=
await
this
.
api
.
getSimilarWindows
(
this
.
_queryWindow
,
this
.
tables
);
console
.
log
(
this
.
windowSimilarity
);
return
this
.
windowSimilarity
;
}
...
...
@@ -87,7 +86,6 @@ export class CacheService {
async
getQueryWindow
(
window
):
Promise
<
number
[]
>
{
this
.
queryWindow
=
await
this
.
api
.
getQueryWindow
(
window
);
console
.
log
(
this
.
_queryWindow
);
return
this
.
_queryWindow
;
}
...
...
AngularApp/prototype/src/app/overview-window/overview-window.component.ts
View file @
660d72ed
...
...
@@ -136,7 +136,6 @@ export class OverviewWindowComponent implements OnInit {
this
.
series
[
1
].
values
=
this
.
goodLabels
;
this
.
series
[
2
].
values
=
this
.
badLabels
;
this
.
config
.
scaleX
.
markers
=
this
.
markers
;
console
.
log
(
this
.
config
);
zingchart
.
exec
(
"
zingchart-ng-1
"
,
'
setdata
'
,
{
data
:
this
.
config
});
...
...
@@ -149,10 +148,8 @@ export class OverviewWindowComponent implements OnInit {
console
.
log
(
"
Updating chart
"
);
let
candidates
=
[];
for
(
let
i
=
sliderIndex
;
i
<
this
.
service
.
nrOfTables
;
i
++
)
{
console
.
log
(
i
);
candidates
=
candidates
.
concat
(
this
.
service
.
windowSimilarity
[
sliderIndex
.
toString
()]);
}
console
.
log
(
candidates
);
const
labels
=
[];
const
markers
=
[];
for
(
const
index
of
candidates
)
{
...
...
AngularApp/prototype/src/app/table-overview/table-overview.component.ts
View file @
660d72ed
...
...
@@ -22,7 +22,6 @@ export class TableOverviewComponent implements OnInit {
}
averagePlot
(
average
):
object
{
console
.
log
(
average
);
return
{
data
:
[
{
...
...
@@ -103,28 +102,30 @@ export class TableOverviewComponent implements OnInit {
const
listOfWindows
=
[];
for
(
const
tableIndex
in
this
.
tables
)
{
const
table
=
this
.
tables
[
tableIndex
];
let
rank
=
undefined
;
let
opacity
=
new
Array
(
Object
.
keys
(
table
.
entries
).
length
);
opacity
.
fill
(
1
);
const
orderedHashes
=
Object
.
keys
(
table
.
entries
).
sort
((
hash1
,
hash2
)
=>
{
return
this
.
distanceMetric
(
hash1
)
-
this
.
distanceMetric
(
hash2
);
});
if
(
this
.
service
.
queryWindow
)
{
const
queryEntry
=
this
.
calculateSignature
(
table
.
hash
,
this
.
service
.
queryWindow
);
listOfWindows
.
push
(
table
.
entries
[
queryEntry
]);
opacity
=
Object
.
keys
(
table
.
entri
es
)
.
map
((
hash
:
string
)
=>
{
opacity
=
orderedHash
es
.
map
((
hash
:
string
)
=>
{
return
hash
===
queryEntry
?
1.0
:
0.5
;
}
);
rank
=
table
.
entries
[
queryEntry
].
length
;
}
const
orderedHashes
=
Object
.
keys
(
table
.
entries
).
sort
((
hash1
,
hash2
)
=>
{
return
this
.
distanceMetric
(
hash1
)
-
this
.
distanceMetric
(
hash2
);
});
console
.
log
(
orderedHashes
);
this
.
subplots
.
push
(
{
rank
:
rank
,
data
:
[{
x
:
orderedHashes
.
map
((
hash
:
string
)
=>
{
return
Number
(
'
0b
'
+
hash
);
x
:
orderedHashes
.
map
((
hash
:
string
,
i
)
=>
{
return
i
;
//
Number('0b' + hash);
}
),
y
:
orderedHashes
.
map
((
hash
:
string
)
=>
table
.
entries
[
hash
].
length
/
(
this
.
service
.
rawValues
.
length
-
this
.
service
.
windowSize
)),
y
:
orderedHashes
.
map
((
hash
:
string
)
=>
table
.
entries
[
hash
].
length
),
//
/ (this.service.rawValues.length - this.service.windowSize)),
type
:
'
bar
'
,
marker
:
{
opacity
...
...
@@ -152,8 +153,8 @@ export class TableOverviewComponent implements OnInit {
}
);
}
this
.
subplots
.
sort
((
plot1
,
plot2
)
=>
plot1
.
rank
-
plot2
.
rank
);
if
(
this
.
service
.
queryWindow
)
{
console
.
log
(
listOfWindows
);
const
temp
=
await
this
.
service
.
getAverageTableWindows
(
listOfWindows
);
this
.
averages
=
temp
.
map
(
x
=>
this
.
averagePlot
(
x
));
}
...
...
Flaskserver/.idea/workspace.xml
View file @
660d72ed
...
...
@@ -2,7 +2,6 @@
<project
version=
"4"
>
<component
name=
"ChangeListManager"
>
<list
default=
"true"
id=
"556080ba-825c-4b55-a92a-867a4df4fb32"
name=
"Default Changelist"
comment=
""
>
<change
beforePath=
"$PROJECT_DIR$/../AngularApp/prototype/src/app/progress-view/progress-view.component.ts"
beforeDir=
"false"
afterPath=
"$PROJECT_DIR$/../AngularApp/prototype/src/app/progress-view/progress-view.component.ts"
afterDir=
"false"
/>
<change
beforePath=
"$PROJECT_DIR$/main.py"
beforeDir=
"false"
afterPath=
"$PROJECT_DIR$/main.py"
afterDir=
"false"
/>
</list>
<option
name=
"EXCLUDED_CONVERTED_TO_IGNORED"
value=
"true"
/>
...
...
@@ -16,8 +15,8 @@
<file
pinned=
"false"
current-in-tab=
"true"
>
<entry
file=
"file://$PROJECT_DIR$/main.py"
>
<provider
selected=
"true"
editor-type-id=
"text-editor"
>
<state
relative-caret-position=
"
330
"
>
<caret
line=
"16
1
"
column=
"
15
"
lean-forward=
"true"
selection-start-line=
"16
1
"
selection-start-column=
"
15
"
selection-end-line=
"16
1
"
selection-end-column=
"
15
"
/>
<state
relative-caret-position=
"
262
"
>
<caret
line=
"16
6
"
column=
"
34
"
lean-forward=
"true"
selection-start-line=
"16
6
"
selection-start-column=
"
34
"
selection-end-line=
"16
6
"
selection-end-column=
"
34
"
/>
<folding>
<element
signature=
"e#0#41#0"
expanded=
"true"
/>
</folding>
...
...
@@ -142,15 +141,15 @@
<workItem
from=
"1599487808817"
duration=
"1192000"
/>
<workItem
from=
"1599578907139"
duration=
"8436000"
/>
<workItem
from=
"1599661275060"
duration=
"1249000"
/>
<workItem
from=
"1600001984238"
duration=
"
3064
000"
/>
<workItem
from=
"1600001984238"
duration=
"
4555
000"
/>
</task>
<servers
/>
</component>
<component
name=
"TimeTrackingManager"
>
<option
name=
"totallyTimeSpent"
value=
"9
7120
000"
/>
<option
name=
"totallyTimeSpent"
value=
"9
8611
000"
/>
</component>
<component
name=
"ToolWindowManager"
>
<frame
x=
"-7"
y=
"-7"
width=
"1295"
height=
"695"
extended-state=
"
7
"
/>
<frame
x=
"-7"
y=
"-7"
width=
"1295"
height=
"695"
extended-state=
"
6
"
/>
<editor
active=
"true"
/>
<layout>
<window_info
content_ui=
"combo"
id=
"Project"
order=
"0"
visible=
"true"
weight=
"0.28698465"
/>
...
...
@@ -209,8 +208,8 @@
</entry>
<entry
file=
"file://$PROJECT_DIR$/main.py"
>
<provider
selected=
"true"
editor-type-id=
"text-editor"
>
<state
relative-caret-position=
"
330
"
>
<caret
line=
"16
1
"
column=
"
15
"
lean-forward=
"true"
selection-start-line=
"16
1
"
selection-start-column=
"
15
"
selection-end-line=
"16
1
"
selection-end-column=
"
15
"
/>
<state
relative-caret-position=
"
262
"
>
<caret
line=
"16
6
"
column=
"
34
"
lean-forward=
"true"
selection-start-line=
"16
6
"
selection-start-column=
"
34
"
selection-end-line=
"16
6
"
selection-end-column=
"
34
"
/>
<folding>
<element
signature=
"e#0#41#0"
expanded=
"true"
/>
</folding>
...
...
Flaskserver/__pycache__/main.cpython-38.pyc
View file @
660d72ed
No preview for this file type
Flaskserver/main.py
View file @
660d72ed
...
...
@@ -165,13 +165,17 @@ def average_table():
t1
=
time
()
actual_windows
=
data
[
windows
]
print
(
len
(
actual_windows
))
max_values
=
np
.
maximum
.
reduce
(
actual_windows
).
tolist
()
min_values
=
np
.
minimum
.
reduce
(
actual_windows
).
tolist
()
average_values
=
(
np
.
sum
(
actual_windows
,
0
)
/
len
(
actual_windows
)).
tolist
()
average_values
=
np
.
average
(
actual_windows
,
0
)
# average_values = (np.sum(actual_windows, 0) / len(actual_windows))
std_values
=
np
.
std
(
actual_windows
,
0
)
max_values
=
average_values
+
std_values
min_values
=
average_values
-
std_values
# max_values = np.maximum.reduce(actual_windows).tolist()
# min_values = np.minimum.reduce(actual_windows).tolist()
output
.
append
({
'average'
:
average_values
,
'max'
:
max_values
,
'min'
:
min_values
'average'
:
average_values
.
tolist
()
,
'max'
:
max_values
.
tolist
()
,
'min'
:
min_values
.
tolist
()
})
print
(
"Average calculated: "
+
str
(
time
()
-
t1
))
response
=
orjson
.
dumps
(
output
)
...
...
Write
Preview
Supports
Markdown
0%
Try again
or
attach a new file
.
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment