Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Contribute to GitLab
Sign in
Toggle navigation
C
CurvedLines
Project
Project
Details
Activity
Cycle Analytics
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Charts
Issues
0
Issues
0
List
Board
Labels
Milestones
Merge Requests
0
Merge Requests
0
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Charts
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Charts
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
HS-public
CurvedLines
Commits
84a5c2e9
Commit
84a5c2e9
authored
Sep 21, 2013
by
MichaelZinsmaier
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
added some comments
parent
bee6f09b
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
8 additions
and
2 deletions
+8
-2
curvedLines.js
curvedLines.js
+8
-2
No files found.
curvedLines.js
View file @
84a5c2e9
...
...
@@ -35,6 +35,8 @@
points. Both modes are achieved through adding of more data points
=> 1) with large data sets you may get trouble
=> 2) if you want to display the points too, you have to plot them as 2nd data series over the lines
&& 3) consecutive x data points are not allowed to have the same value
This is version 0.5 of curvedLines so it will probably not work in every case. However
the basic form of use descirbed next works (:
...
...
@@ -290,7 +292,8 @@
for
(
var
i
=
1
;
i
<
n
-
1
;
++
i
)
{
var
d
=
(
xdata
[
i
+
1
]
-
xdata
[
i
-
1
]);
if
(
d
==
0
)
{
return
null
;
//point before current point and after current point need some space in between
return
[];
}
var
s
=
(
xdata
[
i
]
-
xdata
[
i
-
1
])
/
d
;
...
...
@@ -317,6 +320,7 @@
result
.
push
(
ynew
[
0
]);
for
(
j
=
1
;
j
<
num
;
++
j
)
{
//new x point (sampling point for the created curve)
xnew
[
j
]
=
xnew
[
0
]
+
j
*
step
;
var
max
=
n
-
1
;
...
...
@@ -331,10 +335,12 @@
}
}
//found point one to the left and one to the right of generated new point
var
h
=
(
xdata
[
max
]
-
xdata
[
min
]);
if
(
h
==
0
)
{
return
null
;
//similar to above two points from original x data need some space between them
return
[];
}
var
a
=
(
xdata
[
max
]
-
xnew
[
j
])
/
h
;
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a 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