Skip to content
GitLab
Explore
Sign in
Primary navigation
Search or go to…
Project
R
rndmc
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
GitLab community forum
Contribute to GitLab
Provide feedback
Keyboard shortcuts
?
Snippets
Groups
Projects
Show more breadcrumbs
Jake Read
rndmc
Commits
cc1e1935
Commit
cc1e1935
authored
Aug 20, 2018
by
Jake Read
Browse files
Options
Downloads
Patches
Plain Diff
svg fix
parent
4a7a7120
Branches
Branches containing commit
No related tags found
No related merge requests found
Changes
2
Show whitespace changes
Inline
Side-by-side
Showing
2 changed files
client/client.js
+18
-9
18 additions, 9 deletions
client/client.js
server.js
+1
-1
1 addition, 1 deletion
server.js
with
19 additions
and
10 deletions
client/client.js
+
18
−
9
View file @
cc1e1935
...
...
@@ -149,25 +149,30 @@ function startBezier(x, y, clk){
}
}
var
svgns
=
"
http://www.w3.org/2000/svg
"
;
var
svgns
=
'
http://www.w3.org/2000/svg
'
var
svg
=
{}
// 651
// 1554
function
newBezier
(
x1
,
y1
,
x2
,
y2
)
{
var
bz
=
document
.
createElementNS
(
svgns
,
'
path
'
)
bz
.
style
.
stroke
=
'
#
000
'
bz
.
style
.
stroke
=
'
#
1a1a1a
'
bz
.
style
.
fill
=
'
none
'
bz
.
style
.
strokeWidth
=
'
2
px
'
bz
.
style
.
strokeWidth
=
'
7
px
'
var
bl
=
Math
.
sqrt
(
Math
.
pow
((
x1
-
x2
),
2
)
+
Math
.
pow
((
y1
-
y2
),
2
))
*
0.4
var
ps
=
'
M
'
+
x1
+
'
'
+
y1
+
'
C
'
+
(
x1
+
bl
)
+
'
'
+
y1
var
pe
=
'
'
+
(
x2
-
bl
)
+
'
'
+
y2
+
'
'
+
x2
+
'
'
+
y2
bz
.
setAttribute
(
'
d
'
,
ps
+
pe
)
svg
.
appendChild
(
bz
)
console
.
log
(
bz
)
return
bz
}
function
modifyBezier
(
bz
,
x1
,
y1
,
x2
,
y2
)
{
var
bl
=
Math
.
sqrt
(
Math
.
pow
((
x1
-
x2
),
2
)
+
Math
.
pow
((
y1
-
y2
),
2
))
*
0.
4
var
bl
=
Math
.
sqrt
(
Math
.
pow
((
x1
-
x2
),
2
)
+
Math
.
pow
((
y1
-
y2
),
2
))
*
0.
6
var
ps
=
'
M
'
+
x1
+
'
'
+
y1
+
'
C
'
+
(
x1
+
bl
)
+
'
'
+
y1
var
pe
=
'
'
+
(
x2
-
bl
)
+
'
'
+
y2
+
'
'
+
x2
+
'
'
+
y2
bz
.
setAttribute
(
'
d
'
,
ps
+
pe
)
...
...
@@ -288,7 +293,15 @@ function newState(rep) {
// init & hookup
window
.
onload
=
function
()
{
svg
=
document
.
createElementNS
(
svgns
,
'
svg
'
)
svg
=
document
.
createElementNS
(
'
http://www.w3.org/2000/svg
'
,
'
svg
'
)
svg
.
style
.
position
=
'
absolute
'
svg
.
style
.
left
=
0
svg
.
style
.
top
=
0
svg
.
style
.
zIndex
=
0
svg
.
style
.
overflow
=
'
visible
'
svg
.
setAttribute
(
'
width
'
,
2
)
svg
.
setAttribute
(
'
height
'
,
2
)
svg
.
setAttribute
(
'
id
'
,
'
svg
'
)
svg
.
setAttribute
(
'
width
'
,
'
100%
'
)
svg
.
setAttribute
(
'
height
'
,
'
100%
'
)
document
.
body
.
appendChild
(
svg
)
...
...
@@ -297,10 +310,6 @@ window.onload = function() {
wrapper
.
id
=
'
wrapper
'
document
.
body
.
append
(
wrapper
)
crv
=
newBezier
(
10
,
10
,
100
,
100
)
const
socket
=
new
WebSocket
(
'
ws://localhost:8081
'
)
socket
.
onopen
=
function
(
evt
)
{
...
...
This diff is collapsed.
Click to expand it.
server.js
+
1
−
1
View file @
cc1e1935
...
...
@@ -88,7 +88,7 @@ function addModule(path) {
var
mod
=
new
src
()
modules
.
push
(
mod
)
mod
.
id
=
modules
.
length
-
1
console
.
log
(
'
adding module
'
,
mod
ules
[
modules
.
length
-
1
]
)
console
.
log
(
'
adding module
'
,
mod
.
description
.
name
,
'
id
'
,
mod
.
id
)
// mod.inputs.lineIn.fn('log')
// now roll and return representable object
...
...
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