Skip to content
GitLab
Explore
Sign in
Register
Primary navigation
Search or go to…
Project
D
dummy-vue-grpc
Manage
Activity
Members
Labels
Plan
Issues
Issue boards
Milestones
Wiki
Code
Merge requests
Repository
Branches
Commits
Tags
Repository graph
Compare revisions
Snippets
Build
Pipelines
Jobs
Pipeline schedules
Artifacts
Deploy
Releases
Model registry
Operate
Environments
Monitor
Incidents
Analyze
Value stream analytics
Contributor analytics
CI/CD analytics
Repository analytics
Model experiments
Help
Help
Support
GitLab documentation
Compare GitLab plans
Community forum
Contribute to GitLab
Provide feedback
Keyboard shortcuts
?
Snippets
Groups
Projects
Show more breadcrumbs
vig
provee
dummy-vue-grpc
Commits
1aba4d75
Commit
1aba4d75
authored
4 years ago
by
IsolatedSushi
Browse files
Options
Downloads
Patches
Plain Diff
Fixed chunked knn
parent
e7eb657e
No related branches found
Branches containing commit
No related tags found
1 merge request
!13
Major update
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
backend/webSocketGateway/src/webSocketGateway.js
+14
-0
14 additions, 0 deletions
backend/webSocketGateway/src/webSocketGateway.js
with
14 additions
and
0 deletions
backend/webSocketGateway/src/webSocketGateway.js
+
14
−
0
View file @
1aba4d75
...
@@ -241,6 +241,20 @@ function sendRowToServer(allRows, lineIndex, connection) {
...
@@ -241,6 +241,20 @@ function sendRowToServer(allRows, lineIndex, connection) {
connection
.
knnConn
.
calls
[
0
].
write
(
trainingChunk
);
connection
.
knnConn
.
calls
[
0
].
write
(
trainingChunk
);
}
}
function
sendNeighbour
(
response
,
ws
){
console
.
log
(
response
);
if
(
!
response
||
response
[
"
rows
"
].
length
==
0
){
const
errMSG
=
"
The word (or one of the words) was not in the set (or hasnt been received yet)
"
;
console
.
log
(
errMSG
);
sendError
(
ws
,
errMSG
)
return
;
}
for
(
var
i
=
0
;
i
<
response
[
"
rows
"
].
length
;
i
++
){
console
.
log
(
response
[
"
rows
"
][
i
][
"
id
"
]
+
"
"
+
response
[
"
rows
"
][
i
][
"
distance
"
]);
ws
.
send
(
JSON
.
stringify
({
type
:
"
neighbour
"
,
neighbour
:
response
[
"
rows
"
][
i
][
"
id
"
],
distance
:
response
[
"
rows
"
][
i
][
"
distance
"
].
toString
()}));
}
}
//Send client to browser
//Send client to browser
function
sendDataStreamToClient
(
data
,
ws
)
{
function
sendDataStreamToClient
(
data
,
ws
)
{
var
rows
=
data
[
"
points
"
]
var
rows
=
data
[
"
points
"
]
...
...
This diff is collapsed.
Click to expand it.
Preview
0%
Loading
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!
Save comment
Cancel
Please
register
or
sign in
to comment